1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-09-16 08:26:23 +02:00

Fixed AV and build error in win64. Support for CEF 3.2924.1571.gcdcdfa9 and new parameter to skip reading dll version in tcefapplication

This commit is contained in:
Salvador Diaz Fau
2017-02-26 16:23:01 +01:00
parent e0b50fa338
commit e592e2716a
12 changed files with 226 additions and 235 deletions

View File

@@ -66,6 +66,14 @@ begin
// Uncomment the following line to change the user agent string. // Uncomment the following line to change the user agent string.
//GlobalCEFApp.AddCustomCommandLine('--user-agent', 'MiniBrowser'); //GlobalCEFApp.AddCustomCommandLine('--user-agent', 'MiniBrowser');
//GlobalCEFApp.LibCef := 'cef\libcef.dll';
//GlobalCEFApp.FrameworkDirPath := 'k:\cef\';
//GlobalCEFApp.ResourcesDirPath := 'k:\cef\';
//GlobalCEFApp.LocalesDirPath := 'k:\cef\locales\';
//GlobalCEFApp.CheckCEFFiles := False;
if GlobalCEFApp.StartMainProcess then if GlobalCEFApp.StartMainProcess then
begin begin
Application.Initialize; Application.Initialize;

View File

@@ -2,10 +2,10 @@
<BorlandProject> <BorlandProject>
<Transactions> <Transactions>
<Transaction>2017/02/11 10:15:32.000.980,=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction> <Transaction>2017/02/11 10:15:32.000.980,=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
<Transaction>2017/02/11 10:16:27.000.174,C:\Users\usuario\Documents\Embarcadero\Studio\Projects\Unit1.pas=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas</Transaction> <Transaction>2017/02/11 10:16:27.000.174,C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.dfm=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\Unit1.dfm</Transaction>
<Transaction>2017/02/11 10:16:27.000.174,C:\Users\usuario\Documents\Embarcadero\Studio\Projects\Unit1.dfm=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.dfm</Transaction> <Transaction>2017/02/11 10:16:27.000.174,C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
<Transaction>2017/02/11 10:16:37.000.392,C:\Users\usuario\Documents\Embarcadero\Studio\Projects\Project1.dproj=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\MiniBrowser.dproj</Transaction> <Transaction>2017/02/11 10:16:37.000.392,C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\MiniBrowser.dproj=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\Project1.dproj</Transaction>
<Transaction>2017/02/11 17:10:26.000.471,=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\Unit1.pas</Transaction> <Transaction>2017/02/11 17:10:26.000.471,=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\Unit1.pas</Transaction>
<Transaction>2017/02/11 17:11:01.000.244,C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uTestExtension.pas=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\Unit1.pas</Transaction> <Transaction>2017/02/11 17:11:01.000.244,C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\Unit1.pas=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uTestExtension.pas</Transaction>
</Transactions> </Transactions>
</BorlandProject> </BorlandProject>

View File

@@ -1,31 +1,20 @@
[Closed Files] [Closed Files]
File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,162,19,177,0,0,, File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,738,90,771,0,0,,
File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas',0,1,98,81,126,0,0,, File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas',0,1,961,23,995,0,0,,
File_2=TSourceModule,'V:\dcef3-2883\demos\guiclient\main.pas',0,1,489,5,526,0,0,, File_2=TSourceModule,'V:\dcef3-2883\src\ceflib.pas',0,1,2391,60,2406,0,0,,
File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFProcessMessage.pas',0,1,12,24,38,0,0,, File_3=TSourceModule,'V:\2924\include\internal\cef_types.h',0,1,173,11,182,0,0,,
File_4=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFv8Context.pas',0,1,27,16,43,0,0,, File_4=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uTestExtension.pas',0,1,1,61,103,0,0,,
File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFv8Handler.pas',0,1,13,19,38,0,0,, File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas',0,1,397,11,431,0,0,,
File_6=TSourceModule,'C:\Program Files\Embarcadero\Studio\17.0\Indy10\Lib\System\IdGlobal.pas',0,1,4258,21,4281,0,0,, File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLibFunctions.pas',0,1,200,75,229,0,0,,
File_7=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRenderProcessHandler.pas',0,1,1,30,38,0,0,, File_7=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFConstants.pas',0,1,208,11,248,0,0,,
File_8=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFBrowserProcessHandler.pas',0,1,7,31,38,0,0,, File_8=TSourceModule,'c:\program files\embarcadero\studio\17.0\SOURCE\RTL\SYS\System.pas',0,1,29880,1,29902,0,0,,
File_9=TSourceModule,'c:\program files\embarcadero\studio\17.0\SOURCE\RTL\SYS\System.Types.pas',0,1,82,1,111,0,0,,
[Modules] [Modules]
Module0=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\MiniBrowser.dproj Module0=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas
Module1=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uTestExtension.pas Module1=default.htm
Module2=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas Count=2
Module3=default.htm
Count=4
EditWindowCount=1 EditWindowCount=1
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\MiniBrowser.dproj]
ModuleType=TBaseProject
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uTestExtension.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas] [C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas]
ModuleType=TSourceModule ModuleType=TSourceModule
FormState=1 FormState=1
@@ -35,12 +24,10 @@ FormOnTop=0
ModuleType=TURLModule ModuleType=TURLModule
[EditWindow0] [EditWindow0]
ViewCount=4 ViewCount=2
CurrentEditView=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\MiniBrowser.dpr CurrentEditView=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas
View0=0 View0=0
View1=1 View1=1
View2=2
View3=3
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=1 Visible=1
@@ -57,18 +44,18 @@ ClientHeight=9428
DockedToMainForm=1 DockedToMainForm=1
BorlandEditorCodeExplorer=BorlandEditorCodeExplorer@EditWindow0 BorlandEditorCodeExplorer=BorlandEditorCodeExplorer@EditWindow0
TopPanelSize=0 TopPanelSize=0
LeftPanelSize=0 LeftPanelSize=1898
LeftPanelClients=PropertyInspector,DockSite3
LeftPanelData=00000800010100000000AA19000000000000016A0700000000000001000000005D0E000009000000446F636B53697465330100000000A12300001100000050726F7065727479496E73706563746F72FFFFFFFF
RightPanelSize=2000 RightPanelSize=2000
RightPanelClients=DockSite2 RightPanelClients=DockSite2,DockSite4
RightPanelData=00000800010100000000AA1900000000000001D0070000000000000100000000A123000009000000446F636B5369746532FFFFFFFF RightPanelData=00000800010100000000AA1900000000000001D00700000000000001000000004312000009000000446F636B53697465320100000000A123000009000000446F636B5369746534FFFFFFFF
BottomPanelSize=0 BottomPanelSize=0
BottomPanelClients=DockSite1,MessageView BottomPanelClients=DockSite1,MessageView
BottomPanelData=0000080001020200000009000000446F636B53697465310F0000004D65737361676556696577466F726D1234000000000000022506000000000000FFFFFFFF BottomPanelData=0000080001020200000009000000446F636B53697465310F0000004D65737361676556696577466F726D1234000000000000022506000000000000FFFFFFFF
BottomMiddlePanelSize=0 BottomMiddlePanelSize=0
BottomMiddlePanelClients=DockSite0,GraphDrawingModel BottomMiddlePanelClients=DockSite0,GraphDrawingModel
BottomMiddelPanelData=0000080001020200000009000000446F636B536974653010000000477261706844726177696E67566965779D1D00000000000002F306000000000000FFFFFFFF BottomMiddelPanelData=0000080001020200000009000000446F636B536974653010000000477261706844726177696E67566965779D1D00000000000002F306000000000000FFFFFFFF
TabDockLeftClients=PropertyInspector=0,DockSite3=1
TabDockRightClients=DockSite4=0
[View0] [View0]
CustomEditViewType=TWelcomePageView CustomEditViewType=TWelcomePageView
@@ -76,37 +63,15 @@ WelcomePageURL=bds:/default.htm
[View1] [View1]
CustomEditViewType=TEditView CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\MiniBrowser.dpr
CursorX=57
CursorY=67
TopLine=28
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\MiniBrowser.dpr
[View2]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas
CursorX=69 CursorX=45
CursorY=181 CursorY=268
TopLine=38 TopLine=233
LeftCol=1 LeftCol=1
Elisions= Elisions=
Bookmarks= Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uMiniBrowser.pas
[View3]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uTestExtension.pas
CursorX=61
CursorY=103
TopLine=31
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\demos\MiniBrowser\uTestExtension.pas
[Watches] [Watches]
Count=0 Count=0
@@ -169,11 +134,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2000 Width=2000
Height=8868 Height=4226
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=8868 ClientHeight=4226
TBDockHeight=5897 TBDockHeight=5897
LRDockWidth=2352 LRDockWidth=2352
Dockable=1 Dockable=1
@@ -206,12 +171,12 @@ Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=0
Width=1875 Width=2000
Height=6738 Height=4339
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1875 ClientWidth=2000
ClientHeight=6738 ClientHeight=4339
TBDockHeight=7152 TBDockHeight=7152
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
@@ -261,8 +226,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-8 Left=-121
Top=-30 Top=-74
Width=1844 Width=1844
Height=3139 Height=3139
MaxLeft=-1 MaxLeft=-1
@@ -315,18 +280,18 @@ StayOnTop=0
[PropertyInspector] [PropertyInspector]
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=0 Visible=1
Docked=1 Docked=1
State=0 State=0
Left=78 Left=0
Top=386 Top=362
Width=1898 Width=1898
Height=7164 Height=5370
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1898 ClientWidth=1898
ClientHeight=7164 ClientHeight=5370
TBDockHeight=7164 TBDockHeight=7119
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@@ -376,8 +341,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-8 Left=-1152
Top=287 Top=243
Width=273 Width=273
Height=359 Height=359
MaxLeft=-1 MaxLeft=-1
@@ -609,12 +574,12 @@ Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=0
Width=1773 Width=1898
Height=6738 Height=3498
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1773 ClientWidth=1898
ClientHeight=6738 ClientHeight=3498
TBDockHeight=3677 TBDockHeight=3677
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
@@ -720,12 +685,12 @@ State=0
Left=0 Left=0
Top=23 Top=23
Width=2000 Width=2000
Height=9170 Height=4529
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=9170 ClientHeight=4529
TBDockHeight=7164 TBDockHeight=7119
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@@ -734,22 +699,22 @@ ActiveTabID=ProjectManager
TabDockClients=ProjectManager,ModelViewTool,DataExplorerContainer,frmDesignPreview,TFileExplorerForm TabDockClients=ProjectManager,ModelViewTool,DataExplorerContainer,frmDesignPreview,TFileExplorerForm
[DockSite3] [DockSite3]
HostDockSite=LeftDockTabSet HostDockSite=DockLeftPanel
DockSiteType=1 DockSiteType=1
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=0 Visible=1
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=23
Width=1898 Width=1898
Height=7164 Height=3498
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1773 ClientWidth=1898
ClientHeight=6738 ClientHeight=3498
TBDockHeight=7164 TBDockHeight=7119
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@@ -758,22 +723,22 @@ ActiveTabID=StructureView
TabDockClients=StructureView,ClassBrowserTool TabDockClients=StructureView,ClassBrowserTool
[DockSite4] [DockSite4]
HostDockSite=RightTabDock HostDockSite=DockRightPanel
DockSiteType=1 DockSiteType=1
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=0 Visible=1
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=454
Width=2000 Width=2000
Height=7164 Height=4339
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1875 ClientWidth=2000
ClientHeight=6738 ClientHeight=4339
TBDockHeight=7164 TBDockHeight=7119
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0

View File

@@ -1,10 +1,10 @@
[Stats] [Stats]
EditorSecs=5349 EditorSecs=8825
DesignerSecs=233 DesignerSecs=233
InspectorSecs=236 InspectorSecs=236
CompileSecs=138273 CompileSecs=450273
OtherSecs=631 OtherSecs=1279
StartTime=11/02/2017 10:51:15 StartTime=11/02/2017 10:51:15
RealKeys=0 RealKeys=0
EffectiveKeys=0 EffectiveKeys=0
DebugSecs=988 DebugSecs=2514

View File

@@ -171,7 +171,7 @@ procedure TMiniBrowserFrm.Chromium1ContextMenuCommand(Sender: TObject;
const params: ICefContextMenuParams; commandId: Integer; const params: ICefContextMenuParams; commandId: Integer;
eventFlags: TCefEventFlags; out Result: Boolean); eventFlags: TCefEventFlags; out Result: Boolean);
var var
TempPoint : TSmallPoint; TempParam : WParam;
begin begin
Result := False; Result := False;
@@ -181,9 +181,8 @@ begin
MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS : MINIBROWSER_CONTEXTMENU_SHOWDEVTOOLS :
begin begin
TempPoint.x := params.XCoord; TempParam := ((params.XCoord and $FFFF) shl 16) or (params.YCoord and $FFFF);
TempPoint.y := params.YCoord; PostMessage(Handle, MINIBROWSER_SHOWDEVTOOLS, TempParam, 0);
PostMessage(Handle, MINIBROWSER_SHOWDEVTOOLS, wParam(TempPoint), 0);
end; end;
MINIBROWSER_CONTEXTMENU_SHOWJSALERT : MINIBROWSER_CONTEXTMENU_SHOWJSALERT :
@@ -260,8 +259,12 @@ begin
end; end;
procedure TMiniBrowserFrm.ShowDevToolsMsg(var aMessage : TMessage); procedure TMiniBrowserFrm.ShowDevToolsMsg(var aMessage : TMessage);
var
TempPoint : TPoint;
begin begin
ShowDevTools(SmallPointToPoint(TSmallPoint(aMessage.wParam))); TempPoint.x := (aMessage.wParam shr 16) and $FFFF;
TempPoint.y := aMessage.wParam and $FFFF;
ShowDevTools(TempPoint);
end; end;
procedure TMiniBrowserFrm.HideDevToolsMsg(var aMessage : TMessage); procedure TMiniBrowserFrm.HideDevToolsMsg(var aMessage : TMessage);
@@ -282,7 +285,7 @@ begin
Chromium1.CloseDevTools(DevTools); Chromium1.CloseDevTools(DevTools);
Splitter1.Visible := False; Splitter1.Visible := False;
DevTools.Visible := False; DevTools.Visible := False;
DevTools.Width := 0; DevTools.Width := 0;
end; end;
end. end.

View File

@@ -255,7 +255,16 @@
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<DeployClass Name="ProjectiOSDeviceResourceRules"/> <DeployClass Name="DependencyModule">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource"> <DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32"> <Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir> <RemoteDir>Contents\Resources</RemoteDir>
@@ -569,16 +578,7 @@
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
</DeployClass> </DeployClass>
<DeployClass Name="DependencyModule"> <DeployClass Name="ProjectiOSDeviceResourceRules"/>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/> <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/> <ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>

View File

@@ -1,14 +1,14 @@
[Closed Files] [Closed Files]
File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,267,67,315,0,0,, File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,262,53,297,0,0,,
File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas',0,1,984,49,1017,0,0,, File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas',0,1,2030,67,2056,0,0,,{1
File_2=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLibFunctions.pas',0,1,31,85,45,0,0,, File_2=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas',0,1,191,46,218,0,0,,
File_3=TSourceModule,'V:\2924\include\internal\cef_types.h',0,1,295,51,318,0,0,,{1 File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas',0,1,216,3,246,0,0,,
File_4=TSourceModule,'V:\2924\include\capi\cef_app_capi.h',0,1,100,1,1,0,0,, File_4=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLibFunctions.pas',0,1,40,3,69,0,0,,
File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFConstants.pas',0,1,55,18,89,0,0,, File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestContextHandler.pas',0,1,31,43,57,0,0,,
File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFWebPluginUnstableCallback.pas',0,1,1,1,1,0,0,, File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestContext.pas',0,1,59,16,65,0,0,,
File_7=TSourceModule,'V:\source_D7\uCEFWebPluginUnstableCallback.pas',0,1,1,1,1,0,0,, File_7=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFCookieManager.pas',0,1,49,3,58,0,0,,
File_8=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFv8Types.pas',0,1,16,1,1,0,0,, File_8=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFInterfaces.pas',0,1,877,20,897,0,0,,
File_9=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFv8Handler.pas',0,1,34,57,81,0,0,, File_9=TSourceModule,'C:\Program Files\Embarcadero\Studio\17.0\Componentes\misc\uMiscFunctions.pas',0,1,6055,26,6083,0,0,,
[Modules] [Modules]
Module0=default.htm Module0=default.htm
@@ -38,7 +38,9 @@ ClientHeight=9428
DockedToMainForm=1 DockedToMainForm=1
BorlandEditorCodeExplorer=BorlandEditorCodeExplorer@EditWindow0 BorlandEditorCodeExplorer=BorlandEditorCodeExplorer@EditWindow0
TopPanelSize=0 TopPanelSize=0
LeftPanelSize=0 LeftPanelSize=1898
LeftPanelClients=PropertyInspector,DockSite3
LeftPanelData=00000800010100000000AA19000000000000016A0700000000000001000000005D0E000009000000446F636B53697465330100000000A12300001100000050726F7065727479496E73706563746F72FFFFFFFF
RightPanelSize=2000 RightPanelSize=2000
RightPanelClients=DockSite2,DockSite4 RightPanelClients=DockSite2,DockSite4
RightPanelData=00000800010100000000AA1900000000000001D00700000000000001000000004312000009000000446F636B53697465320100000000A123000009000000446F636B5369746534FFFFFFFF RightPanelData=00000800010100000000AA1900000000000001D00700000000000001000000004312000009000000446F636B53697465320100000000A123000009000000446F636B5369746534FFFFFFFF
@@ -48,7 +50,6 @@ BottomPanelData=0000080001020200000009000000446F636B53697465310F0000004D65737361
BottomMiddlePanelSize=0 BottomMiddlePanelSize=0
BottomMiddlePanelClients=DockSite0,GraphDrawingModel BottomMiddlePanelClients=DockSite0,GraphDrawingModel
BottomMiddelPanelData=0000080001020200000009000000446F636B536974653010000000477261706844726177696E67566965779D1D00000000000002F306000000000000FFFFFFFF BottomMiddelPanelData=0000080001020200000009000000446F636B536974653010000000477261706844726177696E67566965779D1D00000000000002F306000000000000FFFFFFFF
TabDockLeftClients=PropertyInspector=0,DockSite3=1
[View0] [View0]
CustomEditViewType=TWelcomePageView CustomEditViewType=TWelcomePageView
@@ -208,8 +209,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-8 Left=-148
Top=-30 Top=-137
Width=1844 Width=1844
Height=3139 Height=3139
MaxLeft=-1 MaxLeft=-1
@@ -262,17 +263,17 @@ StayOnTop=0
[PropertyInspector] [PropertyInspector]
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=0 Visible=1
Docked=1 Docked=1
State=0 State=0
Left=78 Left=0
Top=386 Top=362
Width=1898 Width=1898
Height=7164 Height=5370
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1898 ClientWidth=1898
ClientHeight=7164 ClientHeight=5370
TBDockHeight=7164 TBDockHeight=7164
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
@@ -288,11 +289,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2000 Width=2000
Height=6816 Height=6861
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=6816 ClientHeight=6861
TBDockHeight=5964 TBDockHeight=5964
LRDockWidth=2508 LRDockWidth=2508
Dockable=1 Dockable=1
@@ -304,8 +305,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-946 Left=-898
Top=1 Top=-137
Width=2844 Width=2844
Height=6200 Height=6200
MaxLeft=-1 MaxLeft=-1
@@ -323,8 +324,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-1152 Left=-1026
Top=243 Top=-137
Width=273 Width=273
Height=359 Height=359
MaxLeft=-1 MaxLeft=-1
@@ -428,11 +429,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2336 Width=2336
Height=942 Height=1177
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2336 ClientWidth=2336
ClientHeight=942 ClientHeight=1177
TBDockHeight=2321 TBDockHeight=2321
LRDockWidth=2820 LRDockWidth=2820
Dockable=1 Dockable=1
@@ -493,11 +494,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2000 Width=2000
Height=6816 Height=6861
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=6816 ClientHeight=6861
TBDockHeight=4888 TBDockHeight=4888
LRDockWidth=7148 LRDockWidth=7148
Dockable=1 Dockable=1
@@ -509,8 +510,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=249 Left=0
Top=709 Top=0
Width=2859 Width=2859
Height=3206 Height=3206
MaxLeft=-1 MaxLeft=-1
@@ -556,12 +557,12 @@ Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=0
Width=1773 Width=1898
Height=6738 Height=3498
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1773 ClientWidth=1898
ClientHeight=6738 ClientHeight=3498
TBDockHeight=3677 TBDockHeight=3677
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
@@ -576,11 +577,11 @@ State=0
Left=0 Left=0
Top=0 Top=0
Width=2000 Width=2000
Height=6816 Height=6861
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=6816 ClientHeight=6861
TBDockHeight=4888 TBDockHeight=4888
LRDockWidth=5305 LRDockWidth=5305
Dockable=1 Dockable=1
@@ -641,7 +642,7 @@ Visible=0
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
Top=23 Top=0
Width=3820 Width=3820
Height=1424 Height=1424
MaxLeft=-1 MaxLeft=-1
@@ -672,7 +673,7 @@ MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=4529 ClientHeight=4529
TBDockHeight=7119 TBDockHeight=7164
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@@ -681,21 +682,21 @@ ActiveTabID=ProjectManager
TabDockClients=ProjectManager,ModelViewTool,DataExplorerContainer,frmDesignPreview,TFileExplorerForm TabDockClients=ProjectManager,ModelViewTool,DataExplorerContainer,frmDesignPreview,TFileExplorerForm
[DockSite3] [DockSite3]
HostDockSite=LeftDockTabSet HostDockSite=DockLeftPanel
DockSiteType=1 DockSiteType=1
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=0 Visible=1
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=23
Width=1898 Width=1898
Height=7164 Height=3498
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1773 ClientWidth=1898
ClientHeight=6738 ClientHeight=3498
TBDockHeight=7164 TBDockHeight=7164
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
@@ -720,7 +721,7 @@ MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2000 ClientWidth=2000
ClientHeight=4339 ClientHeight=4339
TBDockHeight=7119 TBDockHeight=7164
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0

Binary file not shown.

View File

@@ -1,9 +1,9 @@
[Stats] [Stats]
EditorSecs=36202 EditorSecs=39830
DesignerSecs=14 DesignerSecs=14
InspectorSecs=9 InspectorSecs=9
CompileSecs=689217 CompileSecs=812456
OtherSecs=3488 OtherSecs=4166
StartTime=22/01/2017 10:49:52 StartTime=22/01/2017 10:49:52
RealKeys=0 RealKeys=0
EffectiveKeys=0 EffectiveKeys=0

View File

@@ -113,6 +113,8 @@ type
FBrowserProcessHandler : ICefBrowserProcessHandler; FBrowserProcessHandler : ICefBrowserProcessHandler;
FRenderProcessHandler : ICefRenderProcessHandler; FRenderProcessHandler : ICefRenderProcessHandler;
FLibCef : string; FLibCef : string;
FChromeElf : string;
FAppSettings : TCefSettings;
function LoadCEFlibrary : boolean; function LoadCEFlibrary : boolean;
function Load_cef_app_capi_h : boolean; function Load_cef_app_capi_h : boolean;
@@ -181,7 +183,7 @@ type
procedure App_OnGetRenderProcessHandler(var aCefRenderProcessHandler : ICefRenderProcessHandler); procedure App_OnGetRenderProcessHandler(var aCefRenderProcessHandler : ICefRenderProcessHandler);
public public
constructor Create; constructor Create(aUpdateChromeVer : boolean = True);
destructor Destroy; override; destructor Destroy; override;
procedure AfterConstruction; override; procedure AfterConstruction; override;
procedure AddCustomCommandLine(const aCommandLine : string; const aValue : string = ''); procedure AddCustomCommandLine(const aCommandLine : string; const aValue : string = '');
@@ -288,11 +290,16 @@ uses
const const
CEF_SUPPORTED_VERSION_MAJOR = 3; CEF_SUPPORTED_VERSION_MAJOR = 3;
CEF_SUPPORTED_VERSION_MINOR = 2924; CEF_SUPPORTED_VERSION_MINOR = 2924;
CEF_SUPPORTED_VERSION_RELEASE = 1569; CEF_SUPPORTED_VERSION_RELEASE = 1571;
CEF_SUPPORTED_VERSION_BUILD = 0; CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 56;
CEF_CHROMEELF_VERSION_MINOR = 0;
CEF_CHROMEELF_VERSION_RELEASE = 2924;
CEF_CHROMEELF_VERSION_BUILD = 76;
constructor TCefApplication.Create;
constructor TCefApplication.Create(aUpdateChromeVer : boolean);
begin begin
inherited Create; inherited Create;
@@ -342,8 +349,17 @@ begin
FRenderProcessHandler := nil; FRenderProcessHandler := nil;
FLibLoaded := False; FLibLoaded := False;
FLibCef := 'libcef.dll'; FLibCef := 'libcef.dll';
FChromeElf := 'chrome_elf.dll';
UpdateChromeVersionInfo; FAppSettings.size := SizeOf(TCefSettings);
FillChar(FAppSettings, FAppSettings.size, 0);
FChromeVersionInfo.MajorVer := CEF_CHROMEELF_VERSION_MAJOR;
FChromeVersionInfo.MinorVer := CEF_CHROMEELF_VERSION_MINOR;
FChromeVersionInfo.Release := CEF_CHROMEELF_VERSION_RELEASE;
FChromeVersionInfo.Build := CEF_CHROMEELF_VERSION_BUILD;
if aUpdateChromeVer then UpdateChromeVersionInfo;
IsMultiThread := True; IsMultiThread := True;
@@ -623,8 +639,8 @@ begin
else else
TempDir := ''; TempDir := '';
Result := FileExists('chrome_elf.dll') and Result := FileExists(FChromeElf) and
FileExists(FLibCef) and FileExists(FLibCef) and
FileExists(TempDir + 'd3dcompiler_43.dll') and FileExists(TempDir + 'd3dcompiler_43.dll') and
FileExists(TempDir + 'd3dcompiler_47.dll') and FileExists(TempDir + 'd3dcompiler_47.dll') and
FileExists(TempDir + 'libEGL.dll') and FileExists(TempDir + 'libEGL.dll') and
@@ -670,9 +686,9 @@ var
TempVersion : uint64; TempVersion : uint64;
begin begin
try try
if FileExists('chrome_elf.dll') then if FileExists(FChromeElf) then
begin begin
TempVersion := GetFileVersion('chrome_elf.dll'); TempVersion := GetFileVersion(FChromeElf);
UInt64ToFileVersionInfo(TempVersion, FChromeVersionInfo); UInt64ToFileVersionInfo(TempVersion, FChromeVersionInfo);
end; end;
except except
@@ -762,8 +778,6 @@ begin
end; end;
function TCefApplication.InitializeLibrary : boolean; function TCefApplication.InitializeLibrary : boolean;
var
TempSettings : TCefSettings;
begin begin
Result := False; Result := False;
@@ -771,8 +785,8 @@ begin
if FDeleteCache then DeleteDirContents(FCache); if FDeleteCache then DeleteDirContents(FCache);
if FDeleteCookies then DeleteDirContents(FCookies); if FDeleteCookies then DeleteDirContents(FCookies);
InitializeSettings(TempSettings); InitializeSettings(FAppSettings);
Result := (cef_initialize(@HInstance, @TempSettings, FApp.Wrap, FWindowsSandboxInfo) <> 0); Result := (cef_initialize(@HInstance, @FAppSettings, FApp.Wrap, FWindowsSandboxInfo) <> 0);
except except
on e : exception do on e : exception do
OutputDebugMessage('TCefApplication.InitializeLibrary error: ' + e.Message); OutputDebugMessage('TCefApplication.InitializeLibrary error: ' + e.Message);

View File

@@ -98,6 +98,10 @@ type
FIsOSR : boolean; FIsOSR : boolean;
FInitialized : boolean; FInitialized : boolean;
FClosing : boolean; FClosing : boolean;
FWindowInfo : TCefWindowInfo;
FBrowserSettings : TCefBrowserSettings;
FDevWindowInfo : TCefWindowInfo;
FDevBrowserSettings : TCefBrowserSettings;
// ICefClient // ICefClient
FOnProcessMessageReceived : TOnProcessMessageReceived; FOnProcessMessageReceived : TOnProcessMessageReceived;
@@ -638,6 +642,12 @@ begin
FProxyScriptURL := ''; FProxyScriptURL := '';
FProxyByPassList := ''; FProxyByPassList := '';
FillChar(FWindowInfo, SizeOf(TCefWindowInfo), 0);
FillChar(FDevWindowInfo, SizeOf(TCefWindowInfo), 0);
InitializeSettings(FBrowserSettings);
InitializeSettings(FDevBrowserSettings);
InitializeEvents; InitializeEvents;
inherited Create(AOwner); inherited Create(AOwner);
@@ -829,9 +839,6 @@ begin
end; end;
function TChromium.CreateBrowser(const aBrowserParent : TWinControl; const aWindowName : string) : boolean; function TChromium.CreateBrowser(const aBrowserParent : TWinControl; const aWindowName : string) : boolean;
var
TempInfo : TCefWindowInfo;
TempSettings : TCefBrowserSettings;
begin begin
Result := False; Result := False;
@@ -842,19 +849,19 @@ begin
(GlobalCEFApp <> nil) and (GlobalCEFApp <> nil) and
CreateClientHandler(aBrowserParent = nil) then CreateClientHandler(aBrowserParent = nil) then
begin begin
GetSettings(TempSettings); GetSettings(FBrowserSettings);
if FIsOSR then if FIsOSR then
WindowInfoAsWindowless(TempInfo, FCompHandle, False, aWindowName) WindowInfoAsWindowless(FWindowInfo, FCompHandle, False, aWindowName)
else else
WindowInfoAsChild(TempInfo, aBrowserParent.Handle, aBrowserParent.ClientRect, aWindowName); WindowInfoAsChild(FWindowInfo, aBrowserParent.Handle, aBrowserParent.ClientRect, aWindowName);
if MultithreadApp then if MultithreadApp then
Result := CreateBrowserHost(@TempInfo, FDefaultUrl, @TempSettings, nil) Result := CreateBrowserHost(@FWindowInfo, FDefaultUrl, @FBrowserSettings, nil)
else else
begin begin
FBrowser := CreateBrowserHostSync(@TempInfo, FDefaultUrl, @TempSettings, nil); FBrowser := CreateBrowserHostSync(@FWindowInfo, FDefaultUrl, @FBrowserSettings, nil);
if (FBrowser <> nil) then if (FBrowser <> nil) then
begin begin
@@ -2031,19 +2038,16 @@ end;
procedure TChromium.ShowDevTools(inspectElementAt: TPoint; const aDevTools : TWinControl); procedure TChromium.ShowDevTools(inspectElementAt: TPoint; const aDevTools : TWinControl);
var var
TempInfo : TCefWindowInfo;
TempSettings : TCefBrowserSettings;
TempPoint : TCefPoint; TempPoint : TCefPoint;
TempPPoint : PCefPoint;
begin begin
if not(Initialized) or HasDevTools then Exit; if not(Initialized) or HasDevTools then Exit;
InitializeSettings(TempSettings); InitializeSettings(FDevBrowserSettings);
if (aDevTools <> nil) then if (aDevTools <> nil) then
WindowInfoAsChild(TempInfo, aDevTools.Handle, aDevTools.ClientRect, aDevTools.Name) WindowInfoAsChild(FDevWindowInfo, aDevTools.Handle, aDevTools.ClientRect, aDevTools.Name)
else else
WindowInfoAsPopUp(TempInfo, WindowHandle, DEVTOOLS_WINDOWNAME); WindowInfoAsPopUp(FDevWindowInfo, WindowHandle, DEVTOOLS_WINDOWNAME);
if (inspectElementAt.x <> low(integer)) and if (inspectElementAt.x <> low(integer)) and
@@ -2051,12 +2055,11 @@ begin
begin begin
TempPoint.x := inspectElementAt.x; TempPoint.x := inspectElementAt.x;
TempPoint.y := inspectElementAt.y; TempPoint.y := inspectElementAt.y;
TempPPoint := @TempPoint;
FBrowser.Host.ShowDevTools(@FDevWindowInfo, TCefClientOwn.Create as ICefClient, @FDevBrowserSettings, @TempPoint);
end end
else else
TempPPoint := nil; FBrowser.Host.ShowDevTools(@FDevWindowInfo, TCefClientOwn.Create as ICefClient, @FDevBrowserSettings, nil);
FBrowser.Host.ShowDevTools(@TempInfo, TCefClientOwn.Create as ICefClient, @TempSettings, TempPPoint);
end; end;
procedure TChromium.CloseDevTools(const aDevTools : TWinControl); procedure TChromium.CloseDevTools(const aDevTools : TWinControl);

View File

@@ -209,7 +209,7 @@ end;
function CefString(const str: PCefString): ustring; function CefString(const str: PCefString): ustring;
begin begin
if str <> nil then if (str <> nil) then
SetString(Result, str.str, str.length) SetString(Result, str.str, str.length)
else else
Result := ''; Result := '';
@@ -217,53 +217,50 @@ end;
function CefString(const str: ustring): TCefString; function CefString(const str: ustring): TCefString;
begin begin
Result.str := PChar16(PWideChar(str)); Result.str := PChar16(PWideChar(str));
Result.length := Length(str); Result.length := Length(str);
Result.dtor := nil; Result.dtor := nil;
end; end;
procedure CefStringFree(const str: PCefString); procedure CefStringFree(const str: PCefString);
begin begin
if str <> nil then if (str <> nil) then cef_string_utf16_clear(str);
cef_string_utf16_clear(str);
end; end;
procedure CefStringSet(const str: PCefString; const value: ustring); procedure CefStringSet(const str: PCefString; const value: ustring);
begin begin
if str <> nil then if (str <> nil) then cef_string_utf16_set(PWideChar(value), Length(value), str, 1);
cef_string_utf16_set(PWideChar(value), Length(value), str, 1);
end; end;
function CefStringFreeAndGet(const str: PCefStringUserFree): ustring; function CefStringFreeAndGet(const str: PCefStringUserFree): ustring;
begin begin
if str <> nil then if (str <> nil) then
begin begin
Result := CefString(PCefString(str)); Result := CefString(PCefString(str));
cef_string_userfree_utf16_free(str); cef_string_userfree_utf16_free(str);
end else end
else
Result := ''; Result := '';
end; end;
function CefStringAlloc(const str: ustring): TCefString; function CefStringAlloc(const str: ustring): TCefString;
begin begin
FillChar(Result, SizeOf(Result), 0); FillChar(Result, SizeOf(Result), 0);
if str <> '' then if (str <> '') then cef_string_wide_to_utf16(PWideChar(str), Length(str), @Result);
cef_string_wide_to_utf16(PWideChar(str), Length(str), @Result);
end; end;
procedure _free_string(str: PChar16); stdcall; procedure _free_string(str: PChar16); stdcall;
begin begin
if str <> nil then if (str <> nil) then FreeMem(str);
FreeMem(str);
end; end;
function CefUserFreeString(const str: ustring): PCefStringUserFree; function CefUserFreeString(const str: ustring): PCefStringUserFree;
begin begin
Result := cef_string_userfree_utf16_alloc; Result := cef_string_userfree_utf16_alloc;
Result.length := Length(str); Result.length := Length(str);
GetMem(Result.str, Result.length * SizeOf(TCefChar)); GetMem(Result.str, Result.length * SizeOf(TCefChar));
Move(PCefChar(str)^, Result.str^, Result.length * SizeOf(TCefChar)); Move(PCefChar(str)^, Result.str^, Result.length * SizeOf(TCefChar));
Result.dtor := @_free_string; Result.dtor := @_free_string;
end; end;
function CefExecuteProcess(var app : ICefApp; aWindowsSandboxInfo : Pointer) : integer; function CefExecuteProcess(var app : ICefApp; aWindowsSandboxInfo : Pointer) : integer;
@@ -273,10 +270,10 @@ end;
function CefRegisterExtension(const name, code: ustring; const Handler: ICefv8Handler): Boolean; function CefRegisterExtension(const name, code: ustring; const Handler: ICefv8Handler): Boolean;
var var
n, c: TCefString; n, c : TCefString;
begin begin
n := CefString(name); n := CefString(name);
c := CefString(code); c := CefString(code);
Result := cef_register_extension(@n, @c, CefGetData(handler)) <> 0; Result := cef_register_extension(@n, @c, CefGetData(handler)) <> 0;
end; end;
@@ -292,33 +289,33 @@ end;
function CefTimeToSystemTime(const dt: TCefTime): TSystemTime; function CefTimeToSystemTime(const dt: TCefTime): TSystemTime;
begin begin
Result.wYear := dt.year; Result.wYear := dt.year;
Result.wMonth := dt.month; Result.wMonth := dt.month;
Result.wDayOfWeek := dt.day_of_week; Result.wDayOfWeek := dt.day_of_week;
Result.wDay := dt.day_of_month; Result.wDay := dt.day_of_month;
Result.wHour := dt.hour; Result.wHour := dt.hour;
Result.wMinute := dt.minute; Result.wMinute := dt.minute;
Result.wSecond := dt.second; Result.wSecond := dt.second;
Result.wMilliseconds := dt.millisecond; Result.wMilliseconds := dt.millisecond;
end; end;
function SystemTimeToCefTime(const dt: TSystemTime): TCefTime; function SystemTimeToCefTime(const dt: TSystemTime): TCefTime;
begin begin
Result.year := dt.wYear; Result.year := dt.wYear;
Result.month := dt.wMonth; Result.month := dt.wMonth;
Result.day_of_week := dt.wDayOfWeek; Result.day_of_week := dt.wDayOfWeek;
Result.day_of_month := dt.wDay; Result.day_of_month := dt.wDay;
Result.hour := dt.wHour; Result.hour := dt.wHour;
Result.minute := dt.wMinute; Result.minute := dt.wMinute;
Result.second := dt.wSecond; Result.second := dt.wSecond;
Result.millisecond := dt.wMilliseconds; Result.millisecond := dt.wMilliseconds;
end; end;
function CefTimeToDateTime(const dt: TCefTime): TDateTime; function CefTimeToDateTime(const dt: TCefTime): TDateTime;
var var
st: TSystemTime; st: TSystemTime;
begin begin
st := CefTimeToSystemTime(dt); st := CefTimeToSystemTime(dt);
SystemTimeToTzSpecificLocalTime(nil, @st, @st); SystemTimeToTzSpecificLocalTime(nil, @st, @st);
Result := SystemTimeToDateTime(st); Result := SystemTimeToDateTime(st);
end; end;