-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCefCookieVisitorAdapter.h
43 lines (34 loc) · 1.08 KB
/
CefCookieVisitorAdapter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright © 2012 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#pragma once
#include "Stdafx.h"
#include "TypeConversion.h"
#include "include/cef_cookie.h"
namespace CefSharp
{
namespace Internals
{
private class CefCookieVisitorAdapter : public CefCookieVisitor
{
private:
gcroot<ICookieVisitor^> _visitor;
public:
CefCookieVisitorAdapter(ICookieVisitor^ visitor) :
_visitor(visitor)
{
}
~CefCookieVisitorAdapter()
{
delete _visitor;
_visitor = nullptr;
}
virtual bool Visit(const CefCookie& cefCookie, int count, int total, bool& deleteCookie) override
{
auto cookie = TypeConversion::FromNative(cefCookie);
return _visitor->Visit(cookie, count, total, deleteCookie);
}
IMPLEMENT_REFCOUNTINGM(CefCookieVisitorAdapter);
};
}
}