-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCEF_LCL_CookieManager.inc
66 lines (60 loc) · 2.52 KB
/
CEF_LCL_CookieManager.inc
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//----------------------------------------
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Lazarus.modifiedLGPL
//----------------------------------------
procedure CefCookieManager_VisitAllCookies(const AObj: ICefCookieManager; const visitor: ICefCookieVisitor); extdecl;
begin
handleExceptionBegin
AObj.VisitAllCookies(visitor);
handleExceptionEnd
end;
function CefCookieManager_VisitUrlCookies(const AObj: ICefCookieManager; const url: PChar; includeHttpOnly: LongBool; const visitor: ICefCookieVisitor): LongBool; extdecl;
begin
handleExceptionBegin
Result := AObj.VisitUrlCookies(PCharToUStr(url), includeHttpOnly, visitor);
handleExceptionEnd
end;
function CefCookieManager_SetCookie(const AObj: ICefCookieManager; var CefCookie: PMCefCookie; const callback: ICefSetCookieCallback): LongBool; extdecl;
var
url, name, value, domain, path: ustring;
secure, httponly, hasExpires: LongBool;
creation, lastAccess, expires: double;
sameSite: TCefCookieSameSite;
priority: TCefCookiePriority;
begin
handleExceptionBegin
url := PCharToUStr(CefCookie.url);
name := PCharToUStr(CefCookie.name);
value := PCharToUStr(CefCookie.value);
domain := PCharToUStr(CefCookie.domain);
path := PCharToUStr(CefCookie.path);
secure := Boolean(CefCookie.secure^);
httponly := Boolean(CefCookie.httponly^);
hasExpires := Boolean(CefCookie.has_expires^);
creation := Double(CefCookie.creation^);
lastAccess := Double(CefCookie.last_access^);
expires := Double(CefCookie.expires^);
sameSite := TCefCookieSameSite(CefCookie.same_site^);
priority := TCefCookiePriority(CefCookie.priority^);
Result := AObj.SetCookie(url, name, value, domain, path, secure, httponly, hasExpires, creation, lastAccess, expires, sameSite, priority, callback);
handleExceptionEnd
end;
function CefCookieManager_DeleteCookies(const AObj: ICefCookieManager; const url, cookieName: PChar; const callback: ICefDeleteCookiesCallback): LongBool; extdecl;
begin
handleExceptionBegin
Result := AObj.DeleteCookies(PCharToUStr(url), PCharToUStr(cookieName), callback);
handleExceptionEnd
end;
function CefCookieManager_FlushStore(const AObj: ICefCookieManager; const callback: ICefCompletionCallback): LongBool; extdecl;
begin
handleExceptionBegin
Result := AObj.FlushStore(callback);
handleExceptionEnd
end;
exports
CefCookieManager_VisitAllCookies,
CefCookieManager_VisitUrlCookies,
CefCookieManager_SetCookie,
CefCookieManager_DeleteCookies,
CefCookieManager_FlushStore;