You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-07-02 22:26:53 +02:00
Fixes in string handling and CEF types
- Modified Cefv8Accessor and Cefv8Interceptor helper function declarations. - Fixed and renamed ICefV8Interceptor parameters. - Fixed and renamed ICefV8Accessor parameters. - Modified ICefValue.SetBool parameter. - Fixed ICefMenuModelDelegate.FormatLabel "label" parameter. - Modified CefStringClearAndGet parameter. - Added CefStringInitialize function. - Fixed string handling in TCefRequestContextRef.SetPreference. - Fixed string handling in TCefCustomResourceBundleHandler.GetLocalizedString. - Fixed string handling in TCefResourceHandlerOwn.GetResponseHeaders. - Fixed string handling in TCefResourceRequestHandlerOwn.OnResourceRedirect. - Fixed string handling in TCefStringMapOwn. - Fixed string handling in TCefStringMultimapOwn. - Fixed and renamed ICefv8Handler.Execute parameters. - Adapted JSWindowBindingWithObject demo to new Cefv8Accessor declaration.
This commit is contained in:
@ -50,7 +50,8 @@ uses
|
|||||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes,
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes,
|
||||||
uCEFConstants, uCEFv8Value, uCEFWinControl, uCEFSentinel;
|
uCEFConstants, uCEFv8Value, uCEFWinControl, uCEFSentinel,
|
||||||
|
uCEFChromiumCore;
|
||||||
|
|
||||||
const
|
const
|
||||||
JSDEMO_CONTEXTMENU_EXECFUNCTION = MENU_ID_USER_FIRST + 1;
|
JSDEMO_CONTEXTMENU_EXECFUNCTION = MENU_ID_USER_FIRST + 1;
|
||||||
|
@ -50,7 +50,7 @@ uses
|
|||||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
||||||
uCEFWinControl, uCEFSentinel;
|
uCEFWinControl, uCEFSentinel, uCEFChromiumCore;
|
||||||
|
|
||||||
const
|
const
|
||||||
MINIBROWSER_SHOWTEXTVIEWER = WM_APP + $100;
|
MINIBROWSER_SHOWTEXTVIEWER = WM_APP + $100;
|
||||||
|
@ -53,7 +53,7 @@ uses
|
|||||||
type
|
type
|
||||||
TTestExtensionHandler = class(TCefv8HandlerOwn)
|
TTestExtensionHandler = class(TCefv8HandlerOwn)
|
||||||
protected
|
protected
|
||||||
function Execute(const name: ustring; const obj: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; override;
|
function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -62,7 +62,7 @@ uses
|
|||||||
uCEFMiscFunctions, uCEFConstants, uJSExtension;
|
uCEFMiscFunctions, uCEFConstants, uJSExtension;
|
||||||
|
|
||||||
function TTestExtensionHandler.Execute(const name : ustring;
|
function TTestExtensionHandler.Execute(const name : ustring;
|
||||||
const obj : ICefv8Value;
|
const object_ : ICefv8Value;
|
||||||
const arguments : TCefv8ValueArray;
|
const arguments : TCefv8ValueArray;
|
||||||
var retval : ICefv8Value;
|
var retval : ICefv8Value;
|
||||||
var exception : ustring): Boolean;
|
var exception : ustring): Boolean;
|
||||||
|
@ -50,7 +50,7 @@ uses
|
|||||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
||||||
uCEFWinControl, uCEFSentinel;
|
uCEFWinControl, uCEFSentinel, uCEFChromiumCore;
|
||||||
|
|
||||||
type
|
type
|
||||||
TJSExtensionWithFunctionFrm = class(TForm)
|
TJSExtensionWithFunctionFrm = class(TForm)
|
||||||
|
@ -50,7 +50,7 @@ uses
|
|||||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
||||||
uCEFWinControl, uCEFSentinel;
|
uCEFWinControl, uCEFSentinel, uCEFChromiumCore;
|
||||||
|
|
||||||
type
|
type
|
||||||
TJSWindowBindingWithObjectFrm = class(TForm)
|
TJSWindowBindingWithObjectFrm = class(TForm)
|
||||||
|
@ -49,15 +49,15 @@ type
|
|||||||
protected
|
protected
|
||||||
FMyVal : ustring;
|
FMyVal : ustring;
|
||||||
|
|
||||||
function Get(const name: ustring; const obj: ICefv8Value; out retval : ICefv8Value; var exception: ustring): Boolean; override;
|
function Get(const name: ustring; const object_: ICefv8Value; var retval : ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
function Put(const name: ustring; const obj, value: ICefv8Value; var exception: ustring): Boolean; override;
|
function Set_(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
function TMyV8Accessor.Get(const name : ustring;
|
function TMyV8Accessor.Get(const name : ustring;
|
||||||
const obj : ICefv8Value;
|
const object_ : ICefv8Value;
|
||||||
out retval : ICefv8Value;
|
var retval : ICefv8Value;
|
||||||
var exception : ustring): Boolean;
|
var exception : ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
if (name = 'myval') then
|
if (name = 'myval') then
|
||||||
@ -69,8 +69,8 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMyV8Accessor.Put(const name : ustring;
|
function TMyV8Accessor.Set_(const name : ustring;
|
||||||
const obj : ICefv8Value;
|
const object_ : ICefv8Value;
|
||||||
const value : ICefv8Value;
|
const value : ICefv8Value;
|
||||||
var exception : ustring): Boolean;
|
var exception : ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
|
@ -51,7 +51,7 @@ uses
|
|||||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, ComCtrls, ClipBrd, AppEvnts, ActiveX, ShlObj,
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, ComCtrls, ClipBrd, AppEvnts, ActiveX, ShlObj,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
||||||
uCEFWinControl, uCEFSentinel;
|
uCEFWinControl, uCEFSentinel, uCEFChromiumCore;
|
||||||
|
|
||||||
const
|
const
|
||||||
MINIBROWSER_SHOWDEVTOOLS = WM_APP + $101;
|
MINIBROWSER_SHOWDEVTOOLS = WM_APP + $101;
|
||||||
|
@ -50,7 +50,7 @@ uses
|
|||||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, SyncObjs,
|
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, SyncObjs,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes, uChildForm,
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes, uChildForm,
|
||||||
Vcl.AppEvnts, uCEFWinControl, uCEFSentinel;
|
Vcl.AppEvnts, uCEFWinControl, uCEFSentinel, uCEFChromiumCore;
|
||||||
|
|
||||||
const
|
const
|
||||||
CEF_CREATENEXTCHILD = WM_APP + $A50;
|
CEF_CREATENEXTCHILD = WM_APP + $A50;
|
||||||
|
@ -51,7 +51,7 @@ uses
|
|||||||
Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, AppEvnts,
|
Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, AppEvnts,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFBufferPanel,
|
uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uCEFBufferPanel,
|
||||||
uCEFSentinel;
|
uCEFSentinel, uCEFChromiumCore;
|
||||||
|
|
||||||
const
|
const
|
||||||
// Set this constant to True and load "file://transparency.html" to test a
|
// Set this constant to True and load "file://transparency.html" to test a
|
||||||
|
@ -51,7 +51,7 @@ uses
|
|||||||
Controls, Forms, Dialogs, ExtCtrls,
|
Controls, Forms, Dialogs, ExtCtrls,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes, uMainForm,
|
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes, uMainForm,
|
||||||
uCEFWinControl;
|
uCEFWinControl, uCEFChromiumCore;
|
||||||
|
|
||||||
type
|
type
|
||||||
TChildForm = class(TForm)
|
TChildForm = class(TForm)
|
||||||
|
@ -20,9 +20,8 @@
|
|||||||
<ComponentName Value="JSWindowBindingWithObjectFrm"/>
|
<ComponentName Value="JSWindowBindingWithObjectFrm"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<IsVisibleTab Value="True"/>
|
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<TopLine Value="102"/>
|
<TopLine Value="120"/>
|
||||||
<CursorPos X="82" Y="126"/>
|
<CursorPos X="82" Y="126"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="20"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
@ -32,8 +31,12 @@
|
|||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="uMyV8Accessor.pas"/>
|
<Filename Value="uMyV8Accessor.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<EditorIndex Value="-1"/>
|
<IsVisibleTab Value="True"/>
|
||||||
|
<EditorIndex Value="2"/>
|
||||||
|
<TopLine Value="34"/>
|
||||||
|
<CursorPos X="5" Y="90"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="20"/>
|
||||||
|
<Loaded Value="True"/>
|
||||||
<DefaultSyntaxHighlighter Value="Delphi"/>
|
<DefaultSyntaxHighlighter Value="Delphi"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
</Units>
|
</Units>
|
||||||
|
@ -51,15 +51,15 @@ type
|
|||||||
protected
|
protected
|
||||||
FMyVal : ustring;
|
FMyVal : ustring;
|
||||||
|
|
||||||
function Get(const name: ustring; const obj: ICefv8Value; out retval : ICefv8Value; var exception: ustring): Boolean; override;
|
function Get(const name: ustring; const object_: ICefv8Value; var retval : ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
function Put(const name: ustring; const obj, value: ICefv8Value; var exception: ustring): Boolean; override;
|
function Set_(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
function TMyV8Accessor.Get(const name : ustring;
|
function TMyV8Accessor.Get(const name : ustring;
|
||||||
const obj : ICefv8Value;
|
const object_ : ICefv8Value;
|
||||||
out retval : ICefv8Value;
|
var retval : ICefv8Value;
|
||||||
var exception : ustring): Boolean;
|
var exception : ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
if (name = 'myval') then
|
if (name = 'myval') then
|
||||||
@ -71,8 +71,8 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMyV8Accessor.Put(const name : ustring;
|
function TMyV8Accessor.Set_(const name : ustring;
|
||||||
const obj : ICefv8Value;
|
const object_ : ICefv8Value;
|
||||||
const value : ICefv8Value;
|
const value : ICefv8Value;
|
||||||
var exception : ustring): Boolean;
|
var exception : ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
|
@ -3086,12 +3086,7 @@ begin
|
|||||||
aBrowser.Host.RequestContext.CanSetPreference(aName) then
|
aBrowser.Host.RequestContext.CanSetPreference(aName) then
|
||||||
begin
|
begin
|
||||||
TempValue := TCefValueRef.New;
|
TempValue := TCefValueRef.New;
|
||||||
|
TempValue.SetBool(aValue);
|
||||||
if aValue then
|
|
||||||
TempValue.SetBool(1)
|
|
||||||
else
|
|
||||||
TempValue.SetBool(0);
|
|
||||||
|
|
||||||
Result := aBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError);
|
Result := aBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError);
|
||||||
|
|
||||||
if not(Result) then
|
if not(Result) then
|
||||||
|
@ -192,10 +192,10 @@ begin
|
|||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefDisplayHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefDisplayHandlerOwn) then
|
||||||
begin
|
begin
|
||||||
TempText := CefStringClearAndGet(text^);
|
TempText := CefStringClearAndGet(text);
|
||||||
Result := Ord(TCefDisplayHandlerOwn(TempObject).OnTooltip(TCefBrowserRef.UnWrap(browser),
|
Result := Ord(TCefDisplayHandlerOwn(TempObject).OnTooltip(TCefBrowserRef.UnWrap(browser),
|
||||||
TempText));
|
TempText));
|
||||||
text^ := CefStringAlloc(TempText);
|
if (text <> nil) then text^ := CefStringAlloc(TempText);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -191,12 +191,12 @@ type
|
|||||||
TCefv8ArrayBufferReleaseCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(buffer : Pointer);
|
TCefv8ArrayBufferReleaseCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(buffer : Pointer);
|
||||||
TCefWebPluginInfoVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const info: ICefWebPluginInfo; count, total: Integer): Boolean;
|
TCefWebPluginInfoVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const info: ICefWebPluginInfo; count, total: Integer): Boolean;
|
||||||
TCefWebPluginIsUnstableProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; unstable: Boolean);
|
TCefWebPluginIsUnstableProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; unstable: Boolean);
|
||||||
TCefV8AccessorGetterProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean;
|
TCefV8AccessorGetterProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const object_: ICefv8Value; var value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
TCefV8AccessorSetterProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): Boolean;
|
TCefV8AccessorSetterProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
TCefV8InterceptorGetterByNameProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean;
|
TCefV8InterceptorGetterByNameProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const object_: ICefv8Value; var value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
TCefV8InterceptorSetterByNameProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): Boolean;
|
TCefV8InterceptorSetterByNameProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
TCefV8InterceptorGetterByIndexProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(index: integer; const obj: ICefv8Value; out value: ICefv8Value; const exception: ustring): Boolean;
|
TCefV8InterceptorGetterByIndexProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(index: integer; const object_: ICefv8Value; var value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
TCefV8InterceptorSetterByIndexProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(index: integer; const obj, value: ICefv8Value; const exception: ustring): Boolean;
|
TCefV8InterceptorSetterByIndexProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} function(index: integer; const object_, value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean);
|
TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean);
|
||||||
TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument);
|
TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument);
|
||||||
TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument);
|
TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument);
|
||||||
@ -906,25 +906,25 @@ type
|
|||||||
// /include/capi/cef_v8_capi.h (cef_v8handler_t)
|
// /include/capi/cef_v8_capi.h (cef_v8handler_t)
|
||||||
ICefv8Handler = interface(ICefBaseRefCounted)
|
ICefv8Handler = interface(ICefBaseRefCounted)
|
||||||
['{F94CDC60-FDCB-422D-96D5-D2A775BD5D73}']
|
['{F94CDC60-FDCB-422D-96D5-D2A775BD5D73}']
|
||||||
function Execute(const name: ustring; const obj: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean;
|
function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefV8Interceptor
|
// TCefV8Interceptor
|
||||||
// /include/capi/cef_v8_capi.h (cef_v8interceptor_t)
|
// /include/capi/cef_v8_capi.h (cef_v8interceptor_t)
|
||||||
ICefV8Interceptor = interface(ICefBaseRefCounted)
|
ICefV8Interceptor = interface(ICefBaseRefCounted)
|
||||||
['{B3B8FD7C-A916-4B25-93A2-2892AC324F21}']
|
['{B3B8FD7C-A916-4B25-93A2-2892AC324F21}']
|
||||||
function GetByName(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean;
|
function GetByName(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean;
|
||||||
function GetByIndex(index: integer; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean;
|
function GetByIndex(index: integer; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean;
|
||||||
function SetByName(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): boolean;
|
function SetByName(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): boolean;
|
||||||
function SetByIndex(index: integer; const obj, value: ICefv8Value; const exception: ustring): boolean;
|
function SetByIndex(index: integer; const object_, value: ICefv8Value; var exception: ustring): boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefV8Accessor
|
// TCefV8Accessor
|
||||||
// /include/capi/cef_v8_capi.h (cef_v8accessor_t)
|
// /include/capi/cef_v8_capi.h (cef_v8accessor_t)
|
||||||
ICefV8Accessor = interface(ICefBaseRefCounted)
|
ICefV8Accessor = interface(ICefBaseRefCounted)
|
||||||
['{DCA6D4A2-726A-4E24-AA64-5E8C731D868A}']
|
['{DCA6D4A2-726A-4E24-AA64-5E8C731D868A}']
|
||||||
function Get(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; var exception: ustring): Boolean;
|
function Get(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): Boolean;
|
||||||
function Put(const name: ustring; const obj, value: ICefv8Value; var exception: ustring): Boolean;
|
function Set_(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefTask
|
// TCefTask
|
||||||
@ -1505,7 +1505,7 @@ type
|
|||||||
function GetDictionary: ICefDictionaryValue;
|
function GetDictionary: ICefDictionaryValue;
|
||||||
function GetList: ICefListValue;
|
function GetList: ICefListValue;
|
||||||
function SetNull: Boolean;
|
function SetNull: Boolean;
|
||||||
function SetBool(value: Integer): Boolean;
|
function SetBool(value: boolean): Boolean;
|
||||||
function SetInt(value: Integer): Boolean;
|
function SetInt(value: Integer): Boolean;
|
||||||
function SetDouble(value: Double): Boolean;
|
function SetDouble(value: Double): Boolean;
|
||||||
function SetString(const value: ustring): Boolean;
|
function SetString(const value: ustring): Boolean;
|
||||||
@ -2213,7 +2213,7 @@ type
|
|||||||
procedure UnhandledCloseSubmenu(const menuModel: ICefMenuModel; isRTL: boolean);
|
procedure UnhandledCloseSubmenu(const menuModel: ICefMenuModel; isRTL: boolean);
|
||||||
procedure MenuWillShow(const menuModel: ICefMenuModel);
|
procedure MenuWillShow(const menuModel: ICefMenuModel);
|
||||||
procedure MenuClosed(const menuModel: ICefMenuModel);
|
procedure MenuClosed(const menuModel: ICefMenuModel);
|
||||||
function FormatLabel(const menuModel: ICefMenuModel; const label_ : ustring) : boolean;
|
function FormatLabel(const menuModel: ICefMenuModel; var label_ : ustring) : boolean;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefServer
|
// TCefServer
|
||||||
|
@ -257,7 +257,7 @@ var
|
|||||||
// /include/internal/cef_logging_internal.h
|
// /include/internal/cef_logging_internal.h
|
||||||
cef_get_min_log_level : function : Integer; cdecl;
|
cef_get_min_log_level : function : Integer; cdecl;
|
||||||
cef_get_vlog_level : function(const file_start: PAnsiChar; N: NativeInt): Integer; cdecl;
|
cef_get_vlog_level : function(const file_start: PAnsiChar; N: NativeInt): Integer; cdecl;
|
||||||
cef_log : procedure(const file_: PAnsiChar; line, severity: Integer; const message: PAnsiChar); cdecl;
|
cef_log : procedure(const file_: PAnsiChar; line, severity: Integer; const message_: PAnsiChar); cdecl;
|
||||||
|
|
||||||
// /include/internal/cef_string_list.h
|
// /include/internal/cef_string_list.h
|
||||||
cef_string_list_alloc : function : TCefStringList; cdecl;
|
cef_string_list_alloc : function : TCefStringList; cdecl;
|
||||||
@ -271,9 +271,9 @@ var
|
|||||||
// /include/internal/cef_string_map.h
|
// /include/internal/cef_string_map.h
|
||||||
cef_string_map_alloc : function : TCefStringMap; cdecl;
|
cef_string_map_alloc : function : TCefStringMap; cdecl;
|
||||||
cef_string_map_size : function(map: TCefStringMap): NativeUInt; cdecl;
|
cef_string_map_size : function(map: TCefStringMap): NativeUInt; cdecl;
|
||||||
cef_string_map_find : function(map: TCefStringMap; const key: PCefString; var value: TCefString): Integer; cdecl;
|
cef_string_map_find : function(map: TCefStringMap; const key: PCefString; value: PCefString): Integer; cdecl;
|
||||||
cef_string_map_key : function(map: TCefStringMap; index: NativeUInt; var key: TCefString): Integer; cdecl;
|
cef_string_map_key : function(map: TCefStringMap; index: NativeUInt; key: PCefString): Integer; cdecl;
|
||||||
cef_string_map_value : function(map: TCefStringMap; index: NativeUInt; var value: TCefString): Integer; cdecl;
|
cef_string_map_value : function(map: TCefStringMap; index: NativeUInt; value: PCefString): Integer; cdecl;
|
||||||
cef_string_map_append : function(map: TCefStringMap; const key, value: PCefString): Integer; cdecl;
|
cef_string_map_append : function(map: TCefStringMap; const key, value: PCefString): Integer; cdecl;
|
||||||
cef_string_map_clear : procedure(map: TCefStringMap); cdecl;
|
cef_string_map_clear : procedure(map: TCefStringMap); cdecl;
|
||||||
cef_string_map_free : procedure(map: TCefStringMap); cdecl;
|
cef_string_map_free : procedure(map: TCefStringMap); cdecl;
|
||||||
@ -282,9 +282,9 @@ var
|
|||||||
cef_string_multimap_alloc : function : TCefStringMultimap; cdecl;
|
cef_string_multimap_alloc : function : TCefStringMultimap; cdecl;
|
||||||
cef_string_multimap_size : function(map: TCefStringMultimap): NativeUInt; cdecl;
|
cef_string_multimap_size : function(map: TCefStringMultimap): NativeUInt; cdecl;
|
||||||
cef_string_multimap_find_count : function(map: TCefStringMultimap; const key: PCefString): NativeUInt; cdecl;
|
cef_string_multimap_find_count : function(map: TCefStringMultimap; const key: PCefString): NativeUInt; cdecl;
|
||||||
cef_string_multimap_enumerate : function(map: TCefStringMultimap; const key: PCefString; value_index: NativeUInt; var value: TCefString): Integer; cdecl;
|
cef_string_multimap_enumerate : function(map: TCefStringMultimap; const key: PCefString; value_index: NativeUInt; value: PCefString): Integer; cdecl;
|
||||||
cef_string_multimap_key : function(map: TCefStringMultimap; index: NativeUInt; var key: TCefString): Integer; cdecl;
|
cef_string_multimap_key : function(map: TCefStringMultimap; index: NativeUInt; key: PCefString): Integer; cdecl;
|
||||||
cef_string_multimap_value : function(map: TCefStringMultimap; index: NativeUInt; var value: TCefString): Integer; cdecl;
|
cef_string_multimap_value : function(map: TCefStringMultimap; index: NativeUInt; value: PCefString): Integer; cdecl;
|
||||||
cef_string_multimap_append : function(map: TCefStringMultimap; const key, value: PCefString): Integer; cdecl;
|
cef_string_multimap_append : function(map: TCefStringMultimap; const key, value: PCefString): Integer; cdecl;
|
||||||
cef_string_multimap_clear : procedure(map: TCefStringMultimap); cdecl;
|
cef_string_multimap_clear : procedure(map: TCefStringMultimap); cdecl;
|
||||||
cef_string_multimap_free : procedure(map: TCefStringMultimap); cdecl;
|
cef_string_multimap_free : procedure(map: TCefStringMultimap); cdecl;
|
||||||
|
@ -60,7 +60,7 @@ type
|
|||||||
procedure UnhandledCloseSubmenu(const menuModel: ICefMenuModel; isRTL: boolean); virtual;
|
procedure UnhandledCloseSubmenu(const menuModel: ICefMenuModel; isRTL: boolean); virtual;
|
||||||
procedure MenuWillShow(const menuModel: ICefMenuModel); virtual;
|
procedure MenuWillShow(const menuModel: ICefMenuModel); virtual;
|
||||||
procedure MenuClosed(const menuModel: ICefMenuModel); virtual;
|
procedure MenuClosed(const menuModel: ICefMenuModel); virtual;
|
||||||
function FormatLabel(const menuModel: ICefMenuModel; const label_ : uString) : boolean; virtual;
|
function FormatLabel(const menuModel: ICefMenuModel; var label_ : ustring) : boolean; virtual;
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
@ -150,13 +150,17 @@ function cef_menu_model_delegate_format_label(self : PCefMenuModelDelegate
|
|||||||
label_ : PCefString) : integer; stdcall;
|
label_ : PCefString) : integer; stdcall;
|
||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
|
TempLabel : ustring;
|
||||||
begin
|
begin
|
||||||
Result := Ord(False);
|
Result := Ord(False);
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefMenuModelDelegateOwn) then
|
if (TempObject <> nil) and (TempObject is TCefMenuModelDelegateOwn) then
|
||||||
Result := Ord(TCefMenuModelDelegateOwn(TempObject).FormatLabel(TCefMenuModelRef.UnWrap(menu_model),
|
begin
|
||||||
CefString(label_)));
|
TempLabel := CefStringClearAndGet(label_);
|
||||||
|
Result := Ord(TCefMenuModelDelegateOwn(TempObject).FormatLabel(TCefMenuModelRef.UnWrap(menu_model), TempLabel));
|
||||||
|
if (label_ <> nil) then label_^ := CefStringAlloc(TempLabel);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TCefMenuModelDelegateOwn.Create;
|
constructor TCefMenuModelDelegateOwn.Create;
|
||||||
@ -207,7 +211,7 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefMenuModelDelegateOwn.FormatLabel(const menuModel: ICefMenuModel; const label_ : uString) : boolean;
|
function TCefMenuModelDelegateOwn.FormatLabel(const menuModel: ICefMenuModel; var label_ : ustring) : boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
@ -78,7 +78,7 @@ function CefGetObject(ptr: Pointer): TObject; {$IFDEF SUPPORTS_INLINE} inline;
|
|||||||
function CefGetData(const i: ICefBaseRefCounted): Pointer; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
|
function CefGetData(const i: ICefBaseRefCounted): Pointer; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
|
||||||
|
|
||||||
function CefStringAlloc(const str: ustring): TCefString;
|
function CefStringAlloc(const str: ustring): TCefString;
|
||||||
function CefStringClearAndGet(var str: TCefString): ustring;
|
function CefStringClearAndGet(str: PCefString): ustring;
|
||||||
|
|
||||||
function CefString(const str: ustring): TCefString; overload;
|
function CefString(const str: ustring): TCefString; overload;
|
||||||
function CefString(const str: PCefString): ustring; overload;
|
function CefString(const str: PCefString): ustring; overload;
|
||||||
@ -86,6 +86,7 @@ function CefUserFreeString(const str: ustring): PCefStringUserFree;
|
|||||||
procedure CefStringFree(const str: PCefString);
|
procedure CefStringFree(const str: PCefString);
|
||||||
function CefStringFreeAndGet(const str: PCefStringUserFree): ustring;
|
function CefStringFreeAndGet(const str: PCefStringUserFree): ustring;
|
||||||
procedure CefStringSet(const str: PCefString; const value: ustring);
|
procedure CefStringSet(const str: PCefString; const value: ustring);
|
||||||
|
procedure CefStringInitialize(const aCefString : PCefString); {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
|
||||||
|
|
||||||
function CefRegisterExtension(const name, code: ustring; const Handler: ICefv8Handler): Boolean;
|
function CefRegisterExtension(const name, code: ustring; const Handler: ICefv8Handler): Boolean;
|
||||||
|
|
||||||
@ -204,6 +205,8 @@ function CefBase64Decode(const data: ustring): ICefBinaryValue;
|
|||||||
function CefUriEncode(const text: ustring; usePlus: Boolean): ustring;
|
function CefUriEncode(const text: ustring; usePlus: Boolean): ustring;
|
||||||
function CefUriDecode(const text: ustring; convertToUtf8: Boolean; unescapeRule: TCefUriUnescapeRule): ustring;
|
function CefUriDecode(const text: ustring; convertToUtf8: Boolean; unescapeRule: TCefUriUnescapeRule): ustring;
|
||||||
|
|
||||||
|
function CefGetPath(const aPathKey : TCefPathKey) : ustring;
|
||||||
|
|
||||||
function CefParseJson(const jsonString: ustring; options: TCefJsonParserOptions): ICefValue;
|
function CefParseJson(const jsonString: ustring; options: TCefJsonParserOptions): ICefValue;
|
||||||
function CefParseJsonAndReturnError(const jsonString : ustring;
|
function CefParseJsonAndReturnError(const jsonString : ustring;
|
||||||
options : TCefJsonParserOptions;
|
options : TCefJsonParserOptions;
|
||||||
@ -293,12 +296,12 @@ begin
|
|||||||
Result := (int64_val shr 32) and $FFFFFFFF;
|
Result := (int64_val shr 32) and $FFFFFFFF;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CefStringClearAndGet(var str: TCefString): ustring;
|
function CefStringClearAndGet(str: PCefString): ustring;
|
||||||
begin
|
begin
|
||||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (str <> nil) and (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
begin
|
begin
|
||||||
Result := CefString(@str);
|
Result := CefString(str);
|
||||||
cef_string_utf16_clear(@str);
|
cef_string_utf16_clear(str);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Result := '';
|
Result := '';
|
||||||
@ -347,7 +350,17 @@ end;
|
|||||||
procedure CefStringSet(const str: PCefString; const value: ustring);
|
procedure CefStringSet(const str: PCefString; const value: ustring);
|
||||||
begin
|
begin
|
||||||
if (str <> nil) and (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (str <> nil) and (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
cef_string_utf16_set(PWideChar(value), Length(value), str, 1);
|
cef_string_utf16_set(PWideChar(value), Length(value), str, Ord(True));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure CefStringInitialize(const aCefString : PCefString); {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
|
||||||
|
begin
|
||||||
|
if (aCefString <> nil) then
|
||||||
|
begin
|
||||||
|
aCefString^.str := nil;
|
||||||
|
aCefString^.length := 0;
|
||||||
|
aCefString^.dtor := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CefStringFreeAndGet(const str: PCefStringUserFree): ustring;
|
function CefStringFreeAndGet(const str: PCefStringUserFree): ustring;
|
||||||
@ -363,7 +376,8 @@ end;
|
|||||||
|
|
||||||
function CefStringAlloc(const str: ustring): TCefString;
|
function CefStringAlloc(const str: ustring): TCefString;
|
||||||
begin
|
begin
|
||||||
FillChar(Result, SizeOf(Result), 0);
|
CefStringInitialize(@Result);
|
||||||
|
|
||||||
if (str <> '') and (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (str <> '') and (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
cef_string_wide_to_utf16(PWideChar(str), Length(str), @Result);
|
cef_string_wide_to_utf16(PWideChar(str), Length(str), @Result);
|
||||||
end;
|
end;
|
||||||
@ -1572,7 +1586,6 @@ begin
|
|||||||
|
|
||||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
begin
|
begin
|
||||||
FillChar(TempParts, sizeof(TempParts), 0);
|
|
||||||
TempParts.spec := CefString(parts.spec);
|
TempParts.spec := CefString(parts.spec);
|
||||||
TempParts.scheme := CefString(parts.scheme);
|
TempParts.scheme := CefString(parts.scheme);
|
||||||
TempParts.username := CefString(parts.username);
|
TempParts.username := CefString(parts.username);
|
||||||
@ -1583,8 +1596,10 @@ begin
|
|||||||
TempParts.path := CefString(parts.path);
|
TempParts.path := CefString(parts.path);
|
||||||
TempParts.query := CefString(parts.query);
|
TempParts.query := CefString(parts.query);
|
||||||
|
|
||||||
FillChar(TempURL, SizeOf(TempURL), 0);
|
CefStringInitialize(@TempURL);
|
||||||
if cef_create_url(@TempParts, @TempURL) <> 0 then Result := CefString(@TempURL);
|
|
||||||
|
if (cef_create_url(@TempParts, @TempURL) <> 0) then
|
||||||
|
Result := CefStringClearAndGet(@TempURL);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1692,10 +1707,10 @@ var
|
|||||||
begin
|
begin
|
||||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
begin
|
begin
|
||||||
FillChar(TempError, SizeOf(TempError), 0);
|
CefStringInitialize(@TempError);
|
||||||
TempJSON := CefString(jsonString);
|
TempJSON := CefString(jsonString);
|
||||||
Result := TCefValueRef.UnWrap(cef_parse_jsonand_return_error(@TempJSON, options, @errorCodeOut, @TempError));
|
Result := TCefValueRef.UnWrap(cef_parse_jsonand_return_error(@TempJSON, options, @errorCodeOut, @TempError));
|
||||||
errorMsgOut := CefString(@TempError);
|
errorMsgOut := CefStringClearAndGet(@TempError);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1705,6 +1720,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function CefGetPath(const aPathKey : TCefPathKey) : ustring;
|
||||||
|
var
|
||||||
|
TempPath : TCefString;
|
||||||
|
begin
|
||||||
|
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
|
begin
|
||||||
|
CefStringInitialize(@TempPath);
|
||||||
|
|
||||||
|
if (cef_get_path(aPathKey, @TempPath) <> 0) then
|
||||||
|
Result := CefStringClearAndGet(@TempPath);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := '';
|
||||||
|
end;
|
||||||
|
|
||||||
function CefWriteJson(const node: ICefValue; options: TCefJsonWriterOptions): ustring;
|
function CefWriteJson(const node: ICefValue; options: TCefJsonWriterOptions): ustring;
|
||||||
begin
|
begin
|
||||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
@ -1732,9 +1762,9 @@ var
|
|||||||
begin
|
begin
|
||||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
begin
|
begin
|
||||||
FillChar(TempPath, SizeOf(TempPath), 0);
|
CefStringInitialize(@TempPath);
|
||||||
Result := cef_get_temp_directory(@TempPath) <> 0;
|
Result := cef_get_temp_directory(@TempPath) <> 0;
|
||||||
tempDir := CefString(@TempPath);
|
tempDir := CefStringClearAndGet(@TempPath);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1749,10 +1779,10 @@ var
|
|||||||
begin
|
begin
|
||||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
begin
|
begin
|
||||||
FillChar(TempPath, SizeOf(TempPath), 0);
|
CefStringInitialize(@TempPath);
|
||||||
TempPref := CefString(prefix);
|
TempPref := CefString(prefix);
|
||||||
Result := cef_create_new_temp_directory(@TempPref, @TempPath) <> 0;
|
Result := cef_create_new_temp_directory(@TempPref, @TempPath) <> 0;
|
||||||
newTempPath := CefString(@TempPath);
|
newTempPath := CefStringClearAndGet(@TempPath);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1767,11 +1797,11 @@ var
|
|||||||
begin
|
begin
|
||||||
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
|
||||||
begin
|
begin
|
||||||
FillChar(TempPath, SizeOf(TempPath), 0);
|
CefStringInitialize(@TempPath);
|
||||||
TempPref := CefString(prefix);
|
TempPref := CefString(prefix);
|
||||||
TempBase := CefString(baseDir);
|
TempBase := CefString(baseDir);
|
||||||
Result := cef_create_temp_directory_in_directory(@TempBase, @TempPref, @TempPath) <> 0;
|
Result := cef_create_temp_directory_in_directory(@TempBase, @TempPref, @TempPath) <> 0;
|
||||||
newDir := CefString(@TempPath);
|
newDir := CefStringClearAndGet(@TempPath);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
@ -275,9 +275,10 @@ begin
|
|||||||
FReadOnly := readonly;
|
FReadOnly := readonly;
|
||||||
FDataType := PDE_TYPE_EMPTY;
|
FDataType := PDE_TYPE_EMPTY;
|
||||||
FValueByte := nil;
|
FValueByte := nil;
|
||||||
FillChar(FValueStr, SizeOf(FValueStr), 0);
|
|
||||||
FSize := 0;
|
FSize := 0;
|
||||||
|
|
||||||
|
CefStringInitialize(@FValueStr);
|
||||||
|
|
||||||
with PCefPostDataElement(FData)^ do
|
with PCefPostDataElement(FData)^ do
|
||||||
begin
|
begin
|
||||||
is_read_only := {$IFDEF FPC}@{$ENDIF}cef_post_data_element_is_read_only;
|
is_read_only := {$IFDEF FPC}@{$ENDIF}cef_post_data_element_is_read_only;
|
||||||
|
@ -134,8 +134,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefRequestContextRef.GetHandler: ICefRequestContextHandler;
|
function TCefRequestContextRef.GetHandler: ICefRequestContextHandler;
|
||||||
|
var
|
||||||
|
TempHandler : PCefRequestContextHandler;
|
||||||
begin
|
begin
|
||||||
Result := TCefRequestContextHandlerRef.UnWrap(PCefRequestContext(FData)^.get_handler(PCefRequestContext(FData)));
|
TempHandler := PCefRequestContext(FData)^.get_handler(PCefRequestContext(FData));
|
||||||
|
|
||||||
|
if (TempHandler <> nil) then
|
||||||
|
Result := TCefRequestContextHandlerRef.UnWrap(TempHandler)
|
||||||
|
else
|
||||||
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TCefRequestContextRef.Global: ICefRequestContext;
|
class function TCefRequestContextRef.Global: ICefRequestContext;
|
||||||
@ -223,10 +230,11 @@ function TCefRequestContextRef.SetPreference(const name : ustring;
|
|||||||
var
|
var
|
||||||
TempName, TempError : TCefString;
|
TempName, TempError : TCefString;
|
||||||
begin
|
begin
|
||||||
|
CefStringInitialize(@TempError);
|
||||||
|
|
||||||
TempName := CefString(name);
|
TempName := CefString(name);
|
||||||
FillChar(TempError, SizeOf(TempError), 0);
|
|
||||||
Result := PCefRequestContext(FData)^.set_preference(PCefRequestContext(FData), @TempName, CefGetData(value), @TempError) <> 0;
|
Result := PCefRequestContext(FData)^.set_preference(PCefRequestContext(FData), @TempName, CefGetData(value), @TempError) <> 0;
|
||||||
error := CefString(@TempError);
|
error := CefStringClearAndGet(@TempError);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefRequestContextRef.ClearCertificateExceptions(const callback: ICefCompletionCallback);
|
procedure TCefRequestContextRef.ClearCertificateExceptions(const callback: ICefCompletionCallback);
|
||||||
|
@ -94,7 +94,7 @@ implementation
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame, uCEFRequest,
|
uCEFMiscFunctions, uCEFLibFunctions, uCEFBrowser, uCEFFrame, uCEFRequest,
|
||||||
uCEFCookieManager, uCEFWebPluginInfo, uCEFRequestContext, uCEFResourceRequestHandler;
|
uCEFWebPluginInfo, uCEFRequestContext, uCEFResourceRequestHandler;
|
||||||
|
|
||||||
// TCefRequestContextHandlerOwn
|
// TCefRequestContextHandlerOwn
|
||||||
|
|
||||||
|
@ -100,7 +100,11 @@ begin
|
|||||||
TempString := '';
|
TempString := '';
|
||||||
Result := Ord(TCefResourceBundleHandlerOwn(TempObject).GetLocalizedString(string_id, TempString));
|
Result := Ord(TCefResourceBundleHandlerOwn(TempObject).GetLocalizedString(string_id, TempString));
|
||||||
|
|
||||||
if (Result <> 0) then string_val^ := CefString(TempString);
|
if (string_val <> nil) then
|
||||||
|
begin
|
||||||
|
CefStringFree(string_val);
|
||||||
|
string_val^ := CefStringAlloc(TempString);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -137,11 +137,13 @@ begin
|
|||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefResourceHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefResourceHandlerOwn) then
|
||||||
|
begin
|
||||||
TCefResourceHandlerOwn(TempObject).GetResponseHeaders(TCefResponseRef.UnWrap(response),
|
TCefResourceHandlerOwn(TempObject).GetResponseHeaders(TCefResponseRef.UnWrap(response),
|
||||||
response_length^,
|
response_length^,
|
||||||
TempRedirect);
|
TempRedirect);
|
||||||
|
CefStringFree(redirectUrl);
|
||||||
if (TempRedirect <> '') then CefStringSet(redirectUrl, TempRedirect);
|
if (redirectUrl <> nil) then redirectUrl^ := CefStringAlloc(TempRedirect);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_resource_handler_skip(self : PCefResourceHandler;
|
function cef_resource_handler_skip(self : PCefResourceHandler;
|
||||||
|
@ -197,17 +197,18 @@ var
|
|||||||
TempURL : ustring;
|
TempURL : ustring;
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
begin
|
begin
|
||||||
TempURL := CefString(new_url);
|
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefResourceRequestHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefResourceRequestHandlerOwn) then
|
||||||
|
begin
|
||||||
|
TempURL := CefStringClearAndGet(new_url);
|
||||||
TCefResourceRequestHandlerOwn(TempObject).OnResourceRedirect(TCefBrowserRef.UnWrap(browser),
|
TCefResourceRequestHandlerOwn(TempObject).OnResourceRedirect(TCefBrowserRef.UnWrap(browser),
|
||||||
TCefFrameRef.UnWrap(frame),
|
TCefFrameRef.UnWrap(frame),
|
||||||
TCefRequestRef.UnWrap(request),
|
TCefRequestRef.UnWrap(request),
|
||||||
TCefResponseRef.UnWrap(response),
|
TCefResponseRef.UnWrap(response),
|
||||||
TempURL);
|
TempURL);
|
||||||
|
if (new_url <> nil) then new_url^ := CefStringAlloc(TempURL);
|
||||||
if (TempURL <> '') then CefStringSet(new_url, TempURL);
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_resource_request_handler_on_resource_response(self : PCefResourceRequestHandler;
|
function cef_resource_request_handler_on_resource_response(self : PCefResourceRequestHandler;
|
||||||
|
@ -148,17 +148,17 @@ begin
|
|||||||
|
|
||||||
if (FHandle <> nil) then
|
if (FHandle <> nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(TempValue, SizeOf(TempValue), 0);
|
CefStringInitialize(@TempValue);
|
||||||
|
|
||||||
if (cef_string_list_value(FHandle, index, @TempValue) <> 0) then
|
if (cef_string_list_value(FHandle, index, @TempValue) <> 0) then
|
||||||
Result := CefString(@TempValue);
|
Result := CefStringClearAndGet(@TempValue);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomStringList.CopyToStrings(const aStrings : TStrings);
|
procedure TCefCustomStringList.CopyToStrings(const aStrings : TStrings);
|
||||||
var
|
var
|
||||||
i, j : NativeUInt;
|
i, j : NativeUInt;
|
||||||
TempString : TCefString;
|
TempValue : TCefString;
|
||||||
begin
|
begin
|
||||||
if (aStrings <> nil) and (FHandle <> nil) then
|
if (aStrings <> nil) and (FHandle <> nil) then
|
||||||
begin
|
begin
|
||||||
@ -167,10 +167,10 @@ begin
|
|||||||
|
|
||||||
while (i < j) do
|
while (i < j) do
|
||||||
begin
|
begin
|
||||||
FillChar(TempString, SizeOf(TCefString), 0);
|
CefStringInitialize(@TempValue);
|
||||||
|
|
||||||
if (cef_string_list_value(FHandle, i, @TempString) <> 0) then
|
if (cef_string_list_value(FHandle, i, @TempValue) <> 0) then
|
||||||
aStrings.Add(CefStringClearAndGet(TempString));
|
aStrings.Add(CefStringClearAndGet(@TempValue));
|
||||||
|
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
|
@ -124,11 +124,12 @@ begin
|
|||||||
|
|
||||||
if (FHandle <> nil) then
|
if (FHandle <> nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(TempValue, SizeOf(TempValue), 0);
|
CefStringInitialize(@TempValue);
|
||||||
|
|
||||||
TempKey := CefString(key);
|
TempKey := CefString(key);
|
||||||
|
|
||||||
if (cef_string_map_find(FHandle, @TempKey, TempValue) <> 0) then
|
if (cef_string_map_find(FHandle, @TempKey, @TempValue) <> 0) then
|
||||||
Result := CefString(@TempValue);
|
Result := CefStringClearAndGet(@TempValue);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -145,10 +146,10 @@ begin
|
|||||||
|
|
||||||
if (FHandle <> nil) then
|
if (FHandle <> nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(TempKey, SizeOf(TempKey), 0);
|
CefStringInitialize(@TempKey);
|
||||||
|
|
||||||
if (cef_string_map_key(FHandle, index, TempKey) <> 0) then
|
if (cef_string_map_key(FHandle, index, @TempKey) <> 0) then
|
||||||
Result := CefString(@TempKey);
|
Result := CefStringClearAndGet(@TempKey);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -168,10 +169,10 @@ begin
|
|||||||
|
|
||||||
if (FHandle <> nil) then
|
if (FHandle <> nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(TempValue, SizeOf(TempValue), 0);
|
CefStringInitialize(@TempValue);
|
||||||
|
|
||||||
if (cef_string_map_value(FHandle, index, TempValue) <> 0) then
|
if (cef_string_map_value(FHandle, index, @TempValue) <> 0) then
|
||||||
Result := CefString(@TempValue);
|
Result := CefStringClearAndGet(@TempValue);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -138,11 +138,12 @@ begin
|
|||||||
|
|
||||||
if (FHandle <> nil) then
|
if (FHandle <> nil) then
|
||||||
begin
|
begin
|
||||||
TempKey := CefString(Key);
|
CefStringInitialize(@TempValue);
|
||||||
FillChar(TempValue, SizeOf(TempValue), 0);
|
|
||||||
|
|
||||||
if (cef_string_multimap_enumerate(FHandle, @TempKey, ValueIndex, TempValue) <> 0) then
|
TempKey := CefString(Key);
|
||||||
Result := CefString(@TempValue);
|
|
||||||
|
if (cef_string_multimap_enumerate(FHandle, @TempKey, ValueIndex, @TempValue) <> 0) then
|
||||||
|
Result := CefStringClearAndGet(@TempValue);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -159,10 +160,10 @@ begin
|
|||||||
|
|
||||||
if (FHandle <> nil) then
|
if (FHandle <> nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(TempKey, SizeOf(TempKey), 0);
|
CefStringInitialize(@TempKey);
|
||||||
|
|
||||||
if (cef_string_multimap_key(FHandle, index, TempKey) <> 0) then
|
if (cef_string_multimap_key(FHandle, index, @TempKey) <> 0) then
|
||||||
Result := CefString(@TempKey);
|
Result := CefStringClearAndGet(@TempKey);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -182,10 +183,10 @@ begin
|
|||||||
|
|
||||||
if (FHandle <> nil) then
|
if (FHandle <> nil) then
|
||||||
begin
|
begin
|
||||||
FillChar(TempValue, SizeOf(TempValue), 0);
|
CefStringInitialize(@TempValue);
|
||||||
|
|
||||||
if (cef_string_multimap_value(FHandle, index, TempValue) <> 0) then
|
if (cef_string_multimap_value(FHandle, index, @TempValue) <> 0) then
|
||||||
Result := CefString(@TempValue);
|
Result := CefStringClearAndGet(@TempValue);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2452,7 +2452,7 @@ type
|
|||||||
// /include/capi/cef_v8_capi.h (cef_v8handler_t)
|
// /include/capi/cef_v8_capi.h (cef_v8handler_t)
|
||||||
TCefv8Handler = record
|
TCefv8Handler = record
|
||||||
base : TCefBaseRefCounted;
|
base : TCefBaseRefCounted;
|
||||||
execute : function(self: PCefv8Handler; const name: PCefString; obj: PCefv8Value; argumentsCount: NativeUInt; const arguments: PPCefV8Value; var retval: PCefV8Value; var exception: TCefString): Integer; stdcall;
|
execute : function(self: PCefv8Handler; const name: PCefString; object_: PCefv8Value; argumentsCount: NativeUInt; const arguments: PPCefV8Value; var retval: PCefV8Value; exception: PCefString): Integer; stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// /include/capi/cef_v8_capi.h (cef_v8exception_t)
|
// /include/capi/cef_v8_capi.h (cef_v8exception_t)
|
||||||
@ -2543,17 +2543,17 @@ type
|
|||||||
// /include/capi/cef_v8_capi.h (cef_v8interceptor_t)
|
// /include/capi/cef_v8_capi.h (cef_v8interceptor_t)
|
||||||
TCefV8Interceptor = record
|
TCefV8Interceptor = record
|
||||||
base : TCefBaseRefCounted;
|
base : TCefBaseRefCounted;
|
||||||
get_byname : function(self: PCefV8Interceptor; const name: PCefString; obj: PCefV8Value; out retval: PCefv8Value; exception: PCefString): integer; stdcall;
|
get_byname : function(self: PCefV8Interceptor; const name: PCefString; object_: PCefV8Value; out retval: PCefv8Value; exception: PCefString): integer; stdcall;
|
||||||
get_byindex : function(self: PCefV8Interceptor; index: integer; obj: PCefV8Value; out retval: PCefv8Value; exception: PCefString): integer; stdcall;
|
get_byindex : function(self: PCefV8Interceptor; index: integer; object_: PCefV8Value; out retval: PCefv8Value; exception: PCefString): integer; stdcall;
|
||||||
set_byname : function(self: PCefV8Interceptor; const name: PCefString; obj, value: PCefv8Value; exception: PCefString): integer; stdcall;
|
set_byname : function(self: PCefV8Interceptor; const name: PCefString; object_, value: PCefv8Value; exception: PCefString): integer; stdcall;
|
||||||
set_byindex : function(self: PCefV8Interceptor; index: integer; obj, value: PCefv8Value; exception: PCefString): integer; stdcall;
|
set_byindex : function(self: PCefV8Interceptor; index: integer; object_, value: PCefv8Value; exception: PCefString): integer; stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// /include/capi/cef_v8_capi.h (cef_v8accessor_t)
|
// /include/capi/cef_v8_capi.h (cef_v8accessor_t)
|
||||||
TCefV8Accessor = record
|
TCefV8Accessor = record
|
||||||
base : TCefBaseRefCounted;
|
base : TCefBaseRefCounted;
|
||||||
get : function(self: PCefV8Accessor; const name: PCefString; obj: PCefv8Value; out retval: PCefv8Value; exception: PCefString): Integer; stdcall;
|
get : function(self: PCefV8Accessor; const name: PCefString; object_: PCefv8Value; out retval: PCefv8Value; exception: PCefString): Integer; stdcall;
|
||||||
put : function(self: PCefV8Accessor; const name: PCefString; obj, value: PCefv8Value; exception: PCefString): Integer; stdcall;
|
set_ : function(self: PCefV8Accessor; const name: PCefString; object_, value: PCefv8Value; exception: PCefString): Integer; stdcall;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// /include/capi/cef_frame_capi.h (cef_frame_t)
|
// /include/capi/cef_frame_capi.h (cef_frame_t)
|
||||||
|
@ -69,7 +69,7 @@ type
|
|||||||
function GetDictionary: ICefDictionaryValue;
|
function GetDictionary: ICefDictionaryValue;
|
||||||
function GetList: ICefListValue;
|
function GetList: ICefListValue;
|
||||||
function SetNull: Boolean;
|
function SetNull: Boolean;
|
||||||
function SetBool(value: Integer): Boolean;
|
function SetBool(value: boolean): Boolean;
|
||||||
function SetInt(value: Integer): Boolean;
|
function SetInt(value: Integer): Boolean;
|
||||||
function SetDouble(value: Double): Boolean;
|
function SetDouble(value: Double): Boolean;
|
||||||
function SetString(const value: ustring): Boolean;
|
function SetString(const value: ustring): Boolean;
|
||||||
@ -167,9 +167,9 @@ begin
|
|||||||
Result := PCefValue(FData)^.set_binary(PCefValue(FData), CefGetData(value)) <> 0;
|
Result := PCefValue(FData)^.set_binary(PCefValue(FData), CefGetData(value)) <> 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefValueRef.SetBool(value: Integer): Boolean;
|
function TCefValueRef.SetBool(value: boolean): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := PCefValue(FData)^.set_bool(PCefValue(FData), value) <> 0;
|
Result := PCefValue(FData)^.set_bool(PCefValue(FData), ord(value)) <> 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefValueRef.SetDictionary(const value: ICefDictionaryValue): Boolean;
|
function TCefValueRef.SetDictionary(const value: ICefDictionaryValue): Boolean;
|
||||||
|
@ -54,8 +54,8 @@ uses
|
|||||||
type
|
type
|
||||||
TCefV8AccessorOwn = class(TCefBaseRefCountedOwn, ICefV8Accessor)
|
TCefV8AccessorOwn = class(TCefBaseRefCountedOwn, ICefV8Accessor)
|
||||||
protected
|
protected
|
||||||
function Get(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; var exception: ustring): Boolean; virtual;
|
function Get(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): Boolean; virtual;
|
||||||
function Put(const name: ustring; const obj, value: ICefv8Value; var exception: ustring): Boolean; virtual;
|
function Set_(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -66,8 +66,8 @@ type
|
|||||||
FGetter: TCefV8AccessorGetterProc;
|
FGetter: TCefV8AccessorGetterProc;
|
||||||
FSetter: TCefV8AccessorSetterProc;
|
FSetter: TCefV8AccessorSetterProc;
|
||||||
|
|
||||||
function Get(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; var exception: ustring): Boolean; override;
|
function Get(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
function Put(const name: ustring; const obj, value: ICefv8Value; var exception: ustring): Boolean; override;
|
function Set_(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const getter: TCefV8AccessorGetterProc; const setter: TCefV8AccessorSetterProc); reintroduce;
|
constructor Create(const getter: TCefV8AccessorGetterProc; const setter: TCefV8AccessorSetterProc); reintroduce;
|
||||||
@ -80,48 +80,76 @@ uses
|
|||||||
|
|
||||||
function cef_v8_accessor_get( self : PCefV8Accessor;
|
function cef_v8_accessor_get( self : PCefV8Accessor;
|
||||||
const name : PCefString;
|
const name : PCefString;
|
||||||
obj : PCefv8Value;
|
object_ : PCefv8Value;
|
||||||
out retval : PCefv8Value;
|
out retval : PCefv8Value;
|
||||||
exception : PCefString): Integer; stdcall;
|
exception : PCefString): Integer; stdcall;
|
||||||
var
|
var
|
||||||
ret : ICefv8Value;
|
|
||||||
TempExcept : ustring;
|
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
|
TempException : ustring;
|
||||||
|
TempReturnValue : ICefv8Value;
|
||||||
|
TempRecObject : ICefv8Value;
|
||||||
begin
|
begin
|
||||||
Result := Ord(False);
|
Result := Ord(False);
|
||||||
TempExcept := CefString(exception);
|
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefV8AccessorOwn) then
|
if (TempObject <> nil) and (TempObject is TCefV8AccessorOwn) then
|
||||||
Result := Ord(TCefV8AccessorOwn(TempObject).Get(CefString(name),
|
try
|
||||||
TCefv8ValueRef.UnWrap(obj),
|
TempRecObject := TCefv8ValueRef.UnWrap(object_);
|
||||||
ret,
|
TempException := '';
|
||||||
TempExcept));
|
TempReturnValue := nil;
|
||||||
|
|
||||||
retval := CefGetData(ret);
|
Result := Ord(TCefV8AccessorOwn(TempObject).Get(CefString(name),
|
||||||
exception^ := CefString(TempExcept);
|
TempRecObject,
|
||||||
|
TempReturnValue,
|
||||||
|
TempException));
|
||||||
|
|
||||||
|
retval := CefGetData(TempReturnValue);
|
||||||
|
|
||||||
|
if (exception <> nil) then
|
||||||
|
begin
|
||||||
|
CefStringFree(exception);
|
||||||
|
exception^ := CefStringAlloc(TempException);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
TempRecObject := nil;
|
||||||
|
TempReturnValue := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_v8_accessor_put( self : PCefV8Accessor;
|
function cef_v8_accessor_set( self : PCefV8Accessor;
|
||||||
const name : PCefString;
|
const name : PCefString;
|
||||||
obj : PCefv8Value;
|
object_ : PCefv8Value;
|
||||||
value : PCefv8Value;
|
value : PCefv8Value;
|
||||||
exception : PCefString): Integer; stdcall;
|
exception : PCefString): Integer; stdcall;
|
||||||
var
|
var
|
||||||
TempExcept : ustring;
|
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
|
TempException : ustring;
|
||||||
|
TempValue : ICefv8Value;
|
||||||
|
TempRecObject : ICefv8Value;
|
||||||
begin
|
begin
|
||||||
Result := Ord(False);
|
Result := Ord(False);
|
||||||
TempExcept := CefString(exception);
|
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefV8AccessorOwn) then
|
if (TempObject <> nil) and (TempObject is TCefV8AccessorOwn) then
|
||||||
Result := Ord(TCefV8AccessorOwn(TempObject).Put(CefString(name),
|
try
|
||||||
TCefv8ValueRef.UnWrap(obj),
|
TempRecObject := TCefv8ValueRef.UnWrap(object_);
|
||||||
TCefv8ValueRef.UnWrap(value),
|
TempValue := TCefv8ValueRef.UnWrap(value);
|
||||||
TempExcept));
|
TempException := '';
|
||||||
|
|
||||||
exception^ := CefString(TempExcept);
|
Result := Ord(TCefV8AccessorOwn(TempObject).Set_(CefString(name),
|
||||||
|
TempRecObject,
|
||||||
|
TempValue,
|
||||||
|
TempException));
|
||||||
|
|
||||||
|
if (exception <> nil) then
|
||||||
|
begin
|
||||||
|
CefStringFree(exception);
|
||||||
|
exception^ := CefStringAlloc(TempException);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
TempRecObject := nil;
|
||||||
|
TempValue := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefV8AccessorOwn
|
// TCefV8AccessorOwn
|
||||||
@ -133,16 +161,16 @@ begin
|
|||||||
with PCefV8Accessor(FData)^ do
|
with PCefV8Accessor(FData)^ do
|
||||||
begin
|
begin
|
||||||
get := {$IFDEF FPC}@{$ENDIF}cef_v8_accessor_get;
|
get := {$IFDEF FPC}@{$ENDIF}cef_v8_accessor_get;
|
||||||
put := {$IFDEF FPC}@{$ENDIF}cef_v8_accessor_put;
|
set_ := {$IFDEF FPC}@{$ENDIF}cef_v8_accessor_set;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefV8AccessorOwn.Get(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; var exception: ustring): Boolean;
|
function TCefV8AccessorOwn.Get(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefV8AccessorOwn.Put(const name: ustring; const obj, value: ICefv8Value; var exception: ustring): Boolean;
|
function TCefV8AccessorOwn.Set_(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
@ -155,18 +183,18 @@ begin
|
|||||||
FSetter := setter;
|
FSetter := setter;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefFastV8Accessor.Get(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; var exception: ustring): Boolean;
|
function TCefFastV8Accessor.Get(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
if Assigned(FGetter) then
|
if Assigned(FGetter) then
|
||||||
Result := FGetter(name, obj, retval, exception)
|
Result := FGetter(name, object_, retval, exception)
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefFastV8Accessor.Put(const name: ustring; const obj, value: ICefv8Value; var exception: ustring): Boolean;
|
function TCefFastV8Accessor.Set_(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
if Assigned(FSetter) then
|
if Assigned(FSetter) then
|
||||||
Result := FSetter(name, obj, value, exception)
|
Result := FSetter(name, object_, value, exception)
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
@ -60,7 +60,7 @@ uses
|
|||||||
type
|
type
|
||||||
TCefv8HandlerRef = class(TCefBaseRefCountedRef, ICefv8Handler)
|
TCefv8HandlerRef = class(TCefBaseRefCountedRef, ICefv8Handler)
|
||||||
protected
|
protected
|
||||||
function Execute(const name: ustring; const obj: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean;
|
function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean;
|
||||||
|
|
||||||
public
|
public
|
||||||
class function UnWrap(data: Pointer): ICefv8Handler;
|
class function UnWrap(data: Pointer): ICefv8Handler;
|
||||||
@ -68,7 +68,7 @@ type
|
|||||||
|
|
||||||
TCefv8HandlerOwn = class(TCefBaseRefCountedOwn, ICefv8Handler)
|
TCefv8HandlerOwn = class(TCefBaseRefCountedOwn, ICefv8Handler)
|
||||||
protected
|
protected
|
||||||
function Execute(const name: ustring; const obj: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; virtual;
|
function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -87,7 +87,7 @@ type
|
|||||||
class function StrToPtr(const str: ustring): Pointer;
|
class function StrToPtr(const str: ustring): Pointer;
|
||||||
class function PtrToStr(p: Pointer): ustring;
|
class function PtrToStr(p: Pointer): ustring;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
function Execute(const name: ustring; const obj: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; override;
|
function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const value: TValue; SyncMainThread: Boolean = False); reintroduce;
|
constructor Create(const value: TValue; SyncMainThread: Boolean = False); reintroduce;
|
||||||
@ -103,70 +103,97 @@ uses
|
|||||||
|
|
||||||
function cef_v8_handler_execute( self : PCefv8Handler;
|
function cef_v8_handler_execute( self : PCefv8Handler;
|
||||||
const name : PCefString;
|
const name : PCefString;
|
||||||
obj : PCefv8Value;
|
object_ : PCefv8Value;
|
||||||
argumentsCount : NativeUInt;
|
argumentsCount : NativeUInt;
|
||||||
const arguments : PPCefV8Value;
|
const arguments : PPCefV8Value;
|
||||||
var retval : PCefV8Value;
|
var retval : PCefV8Value;
|
||||||
var exception : TCefString): Integer; stdcall;
|
exception : PCefString): Integer; stdcall;
|
||||||
var
|
var
|
||||||
args : TCefv8ValueArray;
|
TempArgs : TCefv8ValueArray;
|
||||||
i, j : NativeInt;
|
i : NativeUInt;
|
||||||
ret : ICefv8Value;
|
TempReturnValue : ICefv8Value;
|
||||||
exc : ustring;
|
TempException : ustring;
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
|
TempRecObject : ICefv8Value;
|
||||||
begin
|
begin
|
||||||
Result := -Ord(False);
|
Result := Ord(False);
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefv8HandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefv8HandlerOwn) then
|
||||||
|
try
|
||||||
|
TempRecObject := TCefv8ValueRef.UnWrap(object_);
|
||||||
|
TempReturnValue := nil;
|
||||||
|
TempArgs := nil;
|
||||||
|
TempException := '';
|
||||||
|
|
||||||
|
if (arguments <> nil) and (argumentsCount > 0) then
|
||||||
begin
|
begin
|
||||||
|
SetLength(TempArgs, argumentsCount);
|
||||||
|
|
||||||
i := 0;
|
i := 0;
|
||||||
j := argumentsCount;
|
while (i < argumentsCount) do
|
||||||
|
|
||||||
SetLength(args, j);
|
|
||||||
|
|
||||||
while (i < j) do
|
|
||||||
begin
|
begin
|
||||||
args[i] := TCefv8ValueRef.UnWrap(arguments^[i]);
|
TempArgs[i] := TCefv8ValueRef.UnWrap(arguments^[i]);
|
||||||
|
inc(i);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Result := Ord(TCefv8HandlerOwn(TempObject).Execute(CefString(name),
|
||||||
|
TempRecObject,
|
||||||
|
TempArgs,
|
||||||
|
TempReturnValue,
|
||||||
|
TempException));
|
||||||
|
|
||||||
|
retval := CefGetData(TempReturnValue);
|
||||||
|
|
||||||
|
if (exception <> nil) then
|
||||||
|
begin
|
||||||
|
CefStringFree(exception);
|
||||||
|
exception^ := CefStringAlloc(TempException);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
i := 0;
|
||||||
|
while (i < argumentsCount) do
|
||||||
|
begin
|
||||||
|
TempArgs[i] := nil;
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := -Ord(TCefv8HandlerOwn(TempObject).Execute(CefString(name), TCefv8ValueRef.UnWrap(obj), args, ret, exc));
|
TempRecObject := nil;
|
||||||
retval := CefGetData(ret);
|
TempReturnValue := nil;
|
||||||
ret := nil;
|
|
||||||
exception := CefString(exc);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefv8HandlerRef.Execute(const name : ustring;
|
function TCefv8HandlerRef.Execute(const name : ustring;
|
||||||
const obj : ICefv8Value;
|
const object_ : ICefv8Value;
|
||||||
const arguments : TCefv8ValueArray;
|
const arguments : TCefv8ValueArray;
|
||||||
var retval : ICefv8Value;
|
var retval : ICefv8Value;
|
||||||
var exception : ustring): Boolean;
|
var exception : ustring): Boolean;
|
||||||
var
|
var
|
||||||
args : array of PCefV8Value;
|
TempArgs : array of PCefV8Value;
|
||||||
i, j : Integer;
|
TempLen, i : integer;
|
||||||
ret : PCefV8Value;
|
TempReturnValue : PCefV8Value;
|
||||||
exc : TCefString;
|
TempException : TCefString;
|
||||||
n : TCefString;
|
TempName : TCefString;
|
||||||
begin
|
begin
|
||||||
i := 0;
|
i := 0;
|
||||||
j := Length(arguments);
|
TempLen := Length(arguments);
|
||||||
|
|
||||||
SetLength(args, j);
|
SetLength(TempArgs, TempLen);
|
||||||
|
|
||||||
while (i < j) do
|
while (i < TempLen) do
|
||||||
begin
|
begin
|
||||||
args[i] := CefGetData(arguments[i]);
|
TempArgs[i] := CefGetData(arguments[i]);
|
||||||
inc(i);
|
inc(i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FillChar(exc, SizeOf(exc), 0);
|
CefStringInitialize(@TempException);
|
||||||
ret := nil;
|
|
||||||
n := CefString(name);
|
TempReturnValue := nil;
|
||||||
Result := PCefv8Handler(FData)^.execute(PCefv8Handler(FData), @n, CefGetData(obj), Length(arguments), @args, ret, exc) <> 0;
|
TempName := CefString(name);
|
||||||
retval := TCefv8ValueRef.UnWrap(ret);
|
Result := PCefv8Handler(FData)^.execute(PCefv8Handler(FData), @TempName, CefGetData(object_), TempLen, @TempArgs, TempReturnValue, @TempException) <> 0;
|
||||||
exception := CefStringClearAndGet(exc);
|
retval := TCefv8ValueRef.UnWrap(TempReturnValue);
|
||||||
|
exception := CefStringClearAndGet(@TempException);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TCefv8HandlerRef.UnWrap(data: Pointer): ICefv8Handler;
|
class function TCefv8HandlerRef.UnWrap(data: Pointer): ICefv8Handler;
|
||||||
@ -186,7 +213,7 @@ begin
|
|||||||
PCefv8Handler(FData)^.execute := {$IFDEF FPC}@{$ENDIF}cef_v8_handler_execute;
|
PCefv8Handler(FData)^.execute := {$IFDEF FPC}@{$ENDIF}cef_v8_handler_execute;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefv8HandlerOwn.Execute(const name: ustring; const obj: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean;
|
function TCefv8HandlerOwn.Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
@ -778,8 +805,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
function TCefRTTIExtension.Execute(const name: ustring; const obj: ICefv8Value;
|
function TCefRTTIExtension.Execute(const name : ustring;
|
||||||
const arguments: TCefv8ValueArray; var retval: ICefv8Value;
|
const object_ : ICefv8Value;
|
||||||
|
const arguments : TCefv8ValueArray;
|
||||||
|
var retval : ICefv8Value;
|
||||||
var exception : ustring): Boolean;
|
var exception : ustring): Boolean;
|
||||||
var
|
var
|
||||||
p: PChar;
|
p: PChar;
|
||||||
@ -798,9 +827,9 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
p := PChar(name);
|
p := PChar(name);
|
||||||
m := nil;
|
m := nil;
|
||||||
if obj <> nil then
|
if object_ <> nil then
|
||||||
begin
|
begin
|
||||||
ud := obj.GetUserData;
|
ud := object_.GetUserData;
|
||||||
if ud <> nil then
|
if ud <> nil then
|
||||||
begin
|
begin
|
||||||
{$IFDEF CPUX64}
|
{$IFDEF CPUX64}
|
||||||
|
@ -54,10 +54,10 @@ uses
|
|||||||
type
|
type
|
||||||
TCefV8InterceptorOwn = class(TCefBaseRefCountedOwn, ICefV8Interceptor)
|
TCefV8InterceptorOwn = class(TCefBaseRefCountedOwn, ICefV8Interceptor)
|
||||||
protected
|
protected
|
||||||
function GetByName(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean; virtual;
|
function GetByName(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean; virtual;
|
||||||
function GetByIndex(index: integer; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean; virtual;
|
function GetByIndex(index: integer; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean; virtual;
|
||||||
function SetByName(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): boolean; virtual;
|
function SetByName(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): boolean; virtual;
|
||||||
function SetByIndex(index: integer; const obj, value: ICefv8Value; const exception: ustring): boolean; virtual;
|
function SetByIndex(index: integer; const object_, value: ICefv8Value; var exception: ustring): boolean; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -70,10 +70,10 @@ type
|
|||||||
FGetterByIndex : TCefV8InterceptorGetterByIndexProc;
|
FGetterByIndex : TCefV8InterceptorGetterByIndexProc;
|
||||||
FSetterByIndex : TCefV8InterceptorSetterByIndexProc;
|
FSetterByIndex : TCefV8InterceptorSetterByIndexProc;
|
||||||
|
|
||||||
function GetByName(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean; override;
|
function GetByName(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean; override;
|
||||||
function GetByIndex(index: integer; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean; override;
|
function GetByIndex(index: integer; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean; override;
|
||||||
function SetByName(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): boolean; override;
|
function SetByName(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): boolean; override;
|
||||||
function SetByIndex(index: integer; const obj, value: ICefv8Value; const exception: ustring): boolean; override;
|
function SetByIndex(index: integer; const object_, value: ICefv8Value; var exception: ustring): boolean; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const getterbyname : TCefV8InterceptorGetterByNameProc;
|
constructor Create(const getterbyname : TCefV8InterceptorGetterByNameProc;
|
||||||
@ -89,86 +89,152 @@ uses
|
|||||||
|
|
||||||
function cef_v8_interceptor_get_byname( self : PCefV8Interceptor;
|
function cef_v8_interceptor_get_byname( self : PCefV8Interceptor;
|
||||||
const name : PCefString;
|
const name : PCefString;
|
||||||
obj : PCefV8Value;
|
object_ : PCefV8Value;
|
||||||
out retval : PCefv8Value;
|
out retval : PCefv8Value;
|
||||||
exception : PCefString): Integer; stdcall;
|
exception : PCefString): Integer; stdcall;
|
||||||
var
|
var
|
||||||
ret: ICefv8Value;
|
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
|
TempException : ustring;
|
||||||
|
TempReturnValue : ICefv8Value;
|
||||||
|
TempRecObject : ICefv8Value;
|
||||||
begin
|
begin
|
||||||
Result := Ord(False);
|
Result := Ord(False);
|
||||||
retval := nil;
|
retval := nil;
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefV8InterceptorOwn) then
|
if (TempObject <> nil) and (TempObject is TCefV8InterceptorOwn) then
|
||||||
begin
|
try
|
||||||
Result := Ord(TCefV8InterceptorOwn(TempObject).GetByName(CefString(name),
|
TempRecObject := TCefv8ValueRef.UnWrap(object_);
|
||||||
TCefv8ValueRef.UnWrap(obj),
|
TempException := '';
|
||||||
ret,
|
TempReturnValue := nil;
|
||||||
CefString(exception)));
|
|
||||||
|
|
||||||
retval := CefGetData(ret);
|
Result := Ord(TCefV8InterceptorOwn(TempObject).GetByName(CefString(name),
|
||||||
|
TempRecObject,
|
||||||
|
TempReturnValue,
|
||||||
|
TempException));
|
||||||
|
|
||||||
|
retval := CefGetData(TempReturnValue);
|
||||||
|
|
||||||
|
if (exception <> nil) then
|
||||||
|
begin
|
||||||
|
CefStringFree(exception);
|
||||||
|
exception^ := CefStringAlloc(TempException);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
TempRecObject := nil;
|
||||||
|
TempReturnValue := nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_v8_interceptor_get_byindex( self : PCefV8Interceptor;
|
function cef_v8_interceptor_get_byindex( self : PCefV8Interceptor;
|
||||||
index : integer;
|
index : integer;
|
||||||
obj : PCefV8Value;
|
object_ : PCefV8Value;
|
||||||
out retval : PCefv8Value;
|
out retval : PCefv8Value;
|
||||||
exception : PCefString): integer; stdcall;
|
exception : PCefString): integer; stdcall;
|
||||||
var
|
var
|
||||||
ret: ICefv8Value;
|
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
|
TempException : ustring;
|
||||||
|
TempReturnValue : ICefv8Value;
|
||||||
|
TempRecObject : ICefv8Value;
|
||||||
begin
|
begin
|
||||||
Result := Ord(False);
|
Result := Ord(False);
|
||||||
retval := nil;
|
retval := nil;
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefV8InterceptorOwn) then
|
if (TempObject <> nil) and (TempObject is TCefV8InterceptorOwn) then
|
||||||
begin
|
try
|
||||||
Result := Ord(TCefV8InterceptorOwn(TempObject).GetByIndex(index,
|
TempRecObject := TCefv8ValueRef.UnWrap(object_);
|
||||||
TCefv8ValueRef.UnWrap(obj),
|
TempException := '';
|
||||||
ret,
|
TempReturnValue := nil;
|
||||||
CefString(exception)));
|
|
||||||
|
|
||||||
retval := CefGetData(ret);
|
Result := Ord(TCefV8InterceptorOwn(TempObject).GetByIndex(index,
|
||||||
|
TempRecObject,
|
||||||
|
TempReturnValue,
|
||||||
|
TempException));
|
||||||
|
|
||||||
|
retval := CefGetData(TempReturnValue);
|
||||||
|
|
||||||
|
if (exception <> nil) then
|
||||||
|
begin
|
||||||
|
CefStringFree(exception);
|
||||||
|
exception^ := CefStringAlloc(TempException);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
TempRecObject := nil;
|
||||||
|
TempReturnValue := nil;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_v8_interceptor_set_byname( self : PCefV8Interceptor;
|
function cef_v8_interceptor_set_byname( self : PCefV8Interceptor;
|
||||||
const name : PCefString;
|
const name : PCefString;
|
||||||
obj : PCefV8Value;
|
object_ : PCefV8Value;
|
||||||
value : PCefv8Value;
|
value : PCefv8Value;
|
||||||
exception : PCefString): integer; stdcall;
|
exception : PCefString): integer; stdcall;
|
||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
|
TempException : ustring;
|
||||||
|
TempValue : ICefv8Value;
|
||||||
|
TempRecObject : ICefv8Value;
|
||||||
begin
|
begin
|
||||||
Result := Ord(False);
|
Result := Ord(False);
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefV8InterceptorOwn) then
|
if (TempObject <> nil) and (TempObject is TCefV8InterceptorOwn) then
|
||||||
|
try
|
||||||
|
TempRecObject := TCefv8ValueRef.UnWrap(object_);
|
||||||
|
TempValue := TCefv8ValueRef.UnWrap(value);
|
||||||
|
TempException := '';
|
||||||
|
|
||||||
Result := Ord(TCefV8InterceptorOwn(TempObject).SetByName(CefString(name),
|
Result := Ord(TCefV8InterceptorOwn(TempObject).SetByName(CefString(name),
|
||||||
TCefv8ValueRef.UnWrap(obj),
|
TempRecObject,
|
||||||
TCefv8ValueRef.UnWrap(value),
|
TempValue,
|
||||||
CefString(exception)));
|
TempException));
|
||||||
|
|
||||||
|
if (exception <> nil) then
|
||||||
|
begin
|
||||||
|
CefStringFree(exception);
|
||||||
|
exception^ := CefStringAlloc(TempException);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
TempRecObject := nil;
|
||||||
|
TempValue := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function cef_v8_interceptor_set_byindex(self : PCefV8Interceptor;
|
function cef_v8_interceptor_set_byindex(self : PCefV8Interceptor;
|
||||||
index : integer;
|
index : integer;
|
||||||
obj : PCefV8Value;
|
object_ : PCefV8Value;
|
||||||
value : PCefv8Value;
|
value : PCefv8Value;
|
||||||
exception : PCefString): integer; stdcall;
|
exception : PCefString): integer; stdcall;
|
||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
|
TempException : ustring;
|
||||||
|
TempValue : ICefv8Value;
|
||||||
|
TempRecObject : ICefv8Value;
|
||||||
begin
|
begin
|
||||||
Result := Ord(False);
|
Result := Ord(False);
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefV8InterceptorOwn) then
|
if (TempObject <> nil) and (TempObject is TCefV8InterceptorOwn) then
|
||||||
|
try
|
||||||
|
TempRecObject := TCefv8ValueRef.UnWrap(object_);
|
||||||
|
TempValue := TCefv8ValueRef.UnWrap(value);
|
||||||
|
TempException := '';
|
||||||
|
|
||||||
Result := Ord(TCefV8InterceptorOwn(TempObject).SetByIndex(index,
|
Result := Ord(TCefV8InterceptorOwn(TempObject).SetByIndex(index,
|
||||||
TCefv8ValueRef.UnWrap(obj),
|
TempRecObject,
|
||||||
TCefv8ValueRef.UnWrap(value),
|
TempValue,
|
||||||
CefString(exception)));
|
TempException));
|
||||||
|
|
||||||
|
if (exception <> nil) then
|
||||||
|
begin
|
||||||
|
CefStringFree(exception);
|
||||||
|
exception^ := CefStringAlloc(TempException);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
TempRecObject := nil;
|
||||||
|
TempValue := nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefV8InterceptorOwn
|
// TCefV8InterceptorOwn
|
||||||
@ -186,22 +252,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefV8InterceptorOwn.GetByName(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean;
|
function TCefV8InterceptorOwn.GetByName(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefV8InterceptorOwn.GetByIndex(index: integer; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean;
|
function TCefV8InterceptorOwn.GetByIndex(index: integer; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefV8InterceptorOwn.SetByName(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): boolean;
|
function TCefV8InterceptorOwn.SetByName(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefV8InterceptorOwn.SetByIndex(index: integer; const obj, value: ICefv8Value; const exception: ustring): boolean;
|
function TCefV8InterceptorOwn.SetByIndex(index: integer; const object_, value: ICefv8Value; var exception: ustring): boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
@ -219,34 +285,34 @@ begin
|
|||||||
FSetterByIndex := setterbyindex;
|
FSetterByIndex := setterbyindex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefFastV8Interceptor.GetByName(const name: ustring; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean;
|
function TCefFastV8Interceptor.GetByName(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean;
|
||||||
begin
|
begin
|
||||||
if assigned(FGetterByName) then
|
if assigned(FGetterByName) then
|
||||||
Result := FGetterByName(name, obj, retval, exception)
|
Result := FGetterByName(name, object_, retval, exception)
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefFastV8Interceptor.GetByIndex(index: integer; const obj: ICefv8Value; out retval: ICefv8Value; const exception: ustring): boolean;
|
function TCefFastV8Interceptor.GetByIndex(index: integer; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean;
|
||||||
begin
|
begin
|
||||||
if assigned(FGetterByIndex) then
|
if assigned(FGetterByIndex) then
|
||||||
Result := FGetterByIndex(index, obj, retval, exception)
|
Result := FGetterByIndex(index, object_, retval, exception)
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefFastV8Interceptor.SetByName(const name: ustring; const obj, value: ICefv8Value; const exception: ustring): boolean;
|
function TCefFastV8Interceptor.SetByName(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): boolean;
|
||||||
begin
|
begin
|
||||||
if assigned(FSetterByName) then
|
if assigned(FSetterByName) then
|
||||||
Result := FSetterByName(name, obj, value, exception)
|
Result := FSetterByName(name, object_, value, exception)
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCefFastV8Interceptor.SetByIndex(index: integer; const obj, value: ICefv8Value; const exception: ustring): boolean;
|
function TCefFastV8Interceptor.SetByIndex(index: integer; const object_, value: ICefv8Value; var exception: ustring): boolean;
|
||||||
begin
|
begin
|
||||||
if assigned(FSetterByIndex) then
|
if assigned(FSetterByIndex) then
|
||||||
Result := FSetterByIndex(index, obj, value, exception)
|
Result := FSetterByIndex(index, object_, value, exception)
|
||||||
else
|
else
|
||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : false,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 67,
|
"InternalVersion" : 68,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "78.3.4.0"
|
"Version" : "78.3.4.0"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user