1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

OutputDebugMessage moved to uCEFMiscFunctions, New TCEFApplication.AddCommandLine procedure and TCEFApplication.CheckCEFLibrary enhancements

This commit is contained in:
Salvador Diaz Fau
2017-02-13 10:24:44 +01:00
parent 8aafbee064
commit 9b4bb2a27c
10 changed files with 336 additions and 253 deletions

View File

@@ -255,16 +255,7 @@
<Overwrite>true</Overwrite> <Overwrite>true</Overwrite>
</Platform> </Platform>
</DeployFile> </DeployFile>
<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>
<DeployClass Name="ProjectOSXResource"> <DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32"> <Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir> <RemoteDir>Contents\Resources</RemoteDir>
@@ -578,7 +569,16 @@
<Operation>1</Operation> <Operation>1</Operation>
</Platform> </Platform>
</DeployClass> </DeployClass>
<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>
<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,45 +1,27 @@
[Closed Files] [Closed Files]
File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas',0,1,1722,34,1739,0,0,, File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,741,71,779,0,0,,{1,727,73}
File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFClient.pas',0,1,521,9,547,0,0,, File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas',0,1,957,68,985,0,0,,
File_2=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestHandler.pas',0,1,285,24,301,0,0,, File_2=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas',0,1,1998,7,2013,0,0,,
File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509CertPrincipal.pas',0,1,178,11,198,0,0,, File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFClient.pas',0,1,490,71,507,0,0,,
File_4=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLibFunctions.pas',0,1,196,10,229,0,0,, File_4=TSourceModule,'c:\program files\embarcadero\studio\17.0\SOURCE\RTL\SYS\System.SysUtils.pas',0,1,25193,1,25222,0,0,,
File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFInterfaces.pas',0,1,69,3,103,0,0,, File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas',0,1,421,23,440,0,0,,
File_6=TSourceModule,'V:\dcef3-2883\src\ceflib.pas',0,1,10411,3,10440,0,0,, File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509CertPrincipal.pas',0,1,179,21,194,0,0,,
File_7=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestHandler.pas',0,1,284,48,300,0,0,,
File_8=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFLibFunctions.pas',0,1,196,10,229,0,0,,
File_9=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFInterfaces.pas',0,1,69,3,103,0,0,,
[Modules] [Modules]
Module0=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas Module0=default.htm
Module1=default.htm Count=1
Module2=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas
Module3=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas
Count=4
EditWindowCount=1 EditWindowCount=1
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[default.htm] [default.htm]
ModuleType=TURLModule ModuleType=TURLModule
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas]
ModuleType=TSourceModule
FormState=0
FormOnTop=0
[EditWindow0] [EditWindow0]
ViewCount=4 ViewCount=1
CurrentEditView=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas CurrentView=0
View0=0 View0=0
View1=1
View2=2
View3=3
PercentageSizes=1 PercentageSizes=1
Create=1 Create=1
Visible=1 Visible=1
@@ -56,56 +38,23 @@ 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=0000080001020200000009000000446F636B53697465310F0000004D65737361676556696577466F726D3B3600000000000002110E000000000000FFFFFFFF 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
WelcomePageURL=bds:/default.htm WelcomePageURL=bds:/default.htm
[View1]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas
CursorX=45
CursorY=355
TopLine=350
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas
[View2]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas
CursorX=22
CursorY=350
TopLine=316
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas
[View3]
CustomEditViewType=TEditView
Module=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas
CursorX=17
CursorY=422
TopLine=383
LeftCol=1
Elisions=
Bookmarks=
EditViewName=C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas
[Watches] [Watches]
Count=0 Count=0
@@ -168,11 +117,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
@@ -185,14 +134,14 @@ Visible=0
Docked=1 Docked=1
State=0 State=0
Left=0 Left=0
Top=23 Top=0
Width=2773 Width=2773
Height=3464 Height=1424
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=2773 ClientWidth=2773
ClientHeight=3464 ClientHeight=1424
TBDockHeight=3464 TBDockHeight=1424
LRDockWidth=2773 LRDockWidth=2773
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@@ -205,12 +154,12 @@ Docked=1
State=0 State=0
Left=0 Left=0
Top=0 Top=0
Width=1875 Width=2000
Height=6693 Height=4339
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1875 ClientWidth=2000
ClientHeight=6693 ClientHeight=4339
TBDockHeight=7152 TBDockHeight=7152
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
@@ -260,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
@@ -314,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=1773 ClientWidth=1898
ClientHeight=6738 ClientHeight=5370
TBDockHeight=7164 TBDockHeight=7164
LRDockWidth=1898 LRDockWidth=1898
Dockable=1 Dockable=1
@@ -340,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
@@ -356,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
@@ -375,8 +324,8 @@ Create=1
Visible=0 Visible=0
Docked=1 Docked=1
State=0 State=0
Left=-8 Left=-1026
Top=287 Top=-137
Width=273 Width=273
Height=359 Height=359
MaxLeft=-1 MaxLeft=-1
@@ -480,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
@@ -545,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
@@ -561,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
@@ -608,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
@@ -628,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
@@ -693,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
@@ -719,12 +668,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=7119 TBDockHeight=7164
LRDockWidth=2000 LRDockWidth=2000
Dockable=1 Dockable=1
StayOnTop=0 StayOnTop=0
@@ -733,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
@@ -757,22 +706,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=7119 Height=4339
MaxLeft=-1 MaxLeft=-1
MaxTop=-1 MaxTop=-1
ClientWidth=1875 ClientWidth=2000
ClientHeight=6693 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=29305 EditorSecs=32530
DesignerSecs=14 DesignerSecs=14
InspectorSecs=9 InspectorSecs=9
CompileSecs=513522 CompileSecs=559079
OtherSecs=2686 OtherSecs=2807
StartTime=22/01/2017 10:49:52 StartTime=22/01/2017 10:49:52
RealKeys=0 RealKeys=0
EffectiveKeys=0 EffectiveKeys=0

View File

@@ -48,9 +48,9 @@ interface
uses uses
{$IFDEF DELPHI16_UP} {$IFDEF DELPHI16_UP}
WinApi.Windows, WinApi.Windows, System.Classes,
{$ELSE} {$ELSE}
Windows, Windows, Classes,
{$ENDIF} {$ENDIF}
uCEFTypes, uCEFInterfaces, uCEFBase; uCEFTypes, uCEFInterfaces, uCEFBase;
@@ -101,7 +101,7 @@ type
FDeleteCookies : boolean; FDeleteCookies : boolean;
FApp : TInternalApp; FApp : TInternalApp;
FAppIntf : ICefApp; FAppIntf : ICefApp;
FCustomCommandLine : ustring; FCustomCommandLines : TStringList;
FFlashEnabled : boolean; FFlashEnabled : boolean;
FCheckCEFFiles : boolean; FCheckCEFFiles : boolean;
FLibLoaded : boolean; FLibLoaded : boolean;
@@ -163,6 +163,9 @@ type
function SingleExeProcessing : boolean; function SingleExeProcessing : boolean;
function GetFileVersion(const aFileName : string) : uint64; function GetFileVersion(const aFileName : string) : uint64;
function CheckCEFLibrary : boolean; function CheckCEFLibrary : boolean;
function CheckLocales : boolean;
function CheckResources : boolean;
function CheckDLLs : boolean;
procedure UInt64ToFileVersionInfo(const aVersion : uint64; var aVersionInfo : TFileVersionInfo); procedure UInt64ToFileVersionInfo(const aVersion : uint64; var aVersionInfo : TFileVersionInfo);
procedure UpdateChromeVersionInfo; procedure UpdateChromeVersionInfo;
@@ -177,7 +180,8 @@ type
public public
constructor Create; constructor Create;
destructor Destroy; override; destructor Destroy; override;
procedure OutputDebugMessage(const aMessage : string); procedure AfterConstruction; override;
procedure AddCustomCommandLine(const aCommandLine : string);
function StartMainProcess : boolean; function StartMainProcess : boolean;
function StartSubProcess : boolean; function StartSubProcess : boolean;
@@ -213,7 +217,6 @@ type
property ExternalMessagePump : boolean read FExternalMessagePump write FExternalMessagePump; property ExternalMessagePump : boolean read FExternalMessagePump write FExternalMessagePump;
property DeleteCache : boolean read FDeleteCache write FDeleteCache; property DeleteCache : boolean read FDeleteCache write FDeleteCache;
property DeleteCookies : boolean read FDeleteCookies write FDeleteCookies; property DeleteCookies : boolean read FDeleteCookies write FDeleteCookies;
property CustomCommandLine : ustring read FCustomCommandLine write FCustomCommandLine;
property FlashEnabled : boolean read FFlashEnabled write FFlashEnabled; property FlashEnabled : boolean read FFlashEnabled write FFlashEnabled;
property CheckCEFFiles : boolean read FCheckCEFFiles write FCheckCEFFiles; property CheckCEFFiles : boolean read FCheckCEFFiles write FCheckCEFFiles;
property ChromeMajorVer : uint16 read FChromeVersionInfo.MajorVer; property ChromeMajorVer : uint16 read FChromeVersionInfo.MajorVer;
@@ -275,7 +278,8 @@ uses
{$ELSE} {$ELSE}
Math, IOUtils, SysUtils, Math, IOUtils, SysUtils,
{$ENDIF} {$ENDIF}
uCEFLibFunctions, uCEFMiscFunctions, uCEFSchemeRegistrar, uCEFCommandLine, uCEFConstants; uCEFLibFunctions, uCEFMiscFunctions, uCEFSchemeRegistrar, uCEFCommandLine,
uCEFConstants;
const const
CEF_SUPPORTED_VERSION_MAJOR = 3; CEF_SUPPORTED_VERSION_MAJOR = 3;
@@ -325,7 +329,7 @@ begin
FApp := nil; FApp := nil;
FAppIntf := nil; FAppIntf := nil;
FFlashEnabled := True; FFlashEnabled := True;
FCustomCommandLine := ''; FCustomCommandLines := nil;
FCheckCEFFiles := True; FCheckCEFFiles := True;
FOnRegisterCustomSchemes := nil; FOnRegisterCustomSchemes := nil;
FResourceBundleHandler := nil; FResourceBundleHandler := nil;
@@ -347,18 +351,21 @@ begin
FAppIntf := nil; FAppIntf := nil;
FApp := nil; FApp := nil;
if (FCustomCommandLines <> nil) then FreeAndNil(FCustomCommandLines);
inherited Destroy; inherited Destroy;
end; end;
procedure TCefApplication.OutputDebugMessage(const aMessage : string); procedure TCefApplication.AfterConstruction;
const
DEFAULT_LINE = 1;
begin begin
{$IFDEF DEBUG} inherited AfterConstruction;
OutputDebugString(PWideChar(aMessage + chr(0)));
if FLibLoaded then CefLog('CEF4Delphi', DEFAULT_LINE, CEF_LOG_SEVERITY_ERROR, aMessage); FCustomCommandLines := TStringList.Create;
{$ENDIF} end;
procedure TCefApplication.AddCustomCommandLine(const aCommandLine : string);
begin
if (FCustomCommandLines <> nil) then FCustomCommandLines.Add(aCommandLine);
end; end;
function TCefApplication.CreateInternalApp : boolean; function TCefApplication.CreateInternalApp : boolean;
@@ -473,6 +480,136 @@ begin
aVersionInfo.Build := uint16(aVersion and $FFFF); aVersionInfo.Build := uint16(aVersion and $FFFF);
end; end;
function TCefApplication.CheckLocales : boolean;
var
TempDir : string;
begin
Result := False;
try
if (length(FLocalesDirPath) > 0) then
TempDir := FLocalesDirPath
else
TempDir := 'locales';
Result := DirectoryExists(TempDir) and
FileExists(TempDir + '\am.pak') and
FileExists(TempDir + '\ar.pak') and
FileExists(TempDir + '\bg.pak') and
FileExists(TempDir + '\bn.pak') and
FileExists(TempDir + '\ca.pak') and
FileExists(TempDir + '\cs.pak') and
FileExists(TempDir + '\da.pak') and
FileExists(TempDir + '\de.pak') and
FileExists(TempDir + '\el.pak') and
FileExists(TempDir + '\en-GB.pak') and
FileExists(TempDir + '\en-US.pak') and
FileExists(TempDir + '\es.pak') and
FileExists(TempDir + '\es-419.pak') and
FileExists(TempDir + '\et.pak') and
FileExists(TempDir + '\fa.pak') and
FileExists(TempDir + '\fi.pak') and
FileExists(TempDir + '\fil.pak') and
FileExists(TempDir + '\fr.pak') and
FileExists(TempDir + '\gu.pak') and
FileExists(TempDir + '\he.pak') and
FileExists(TempDir + '\hi.pak') and
FileExists(TempDir + '\hr.pak') and
FileExists(TempDir + '\hu.pak') and
FileExists(TempDir + '\id.pak') and
FileExists(TempDir + '\it.pak') and
FileExists(TempDir + '\ja.pak') and
FileExists(TempDir + '\kn.pak') and
FileExists(TempDir + '\ko.pak') and
FileExists(TempDir + '\lt.pak') and
FileExists(TempDir + '\lv.pak') and
FileExists(TempDir + '\ml.pak') and
FileExists(TempDir + '\mr.pak') and
FileExists(TempDir + '\ms.pak') and
FileExists(TempDir + '\nb.pak') and
FileExists(TempDir + '\nl.pak') and
FileExists(TempDir + '\pl.pak') and
FileExists(TempDir + '\pt-BR.pak') and
FileExists(TempDir + '\pt-PT.pak') and
FileExists(TempDir + '\ro.pak') and
FileExists(TempDir + '\ru.pak') and
FileExists(TempDir + '\sk.pak') and
FileExists(TempDir + '\sl.pak') and
FileExists(TempDir + '\sr.pak') and
FileExists(TempDir + '\sv.pak') and
FileExists(TempDir + '\sw.pak') and
FileExists(TempDir + '\ta.pak') and
FileExists(TempDir + '\te.pak') and
FileExists(TempDir + '\th.pak') and
FileExists(TempDir + '\tr.pak') and
FileExists(TempDir + '\uk.pak') and
FileExists(TempDir + '\vi.pak') and
FileExists(TempDir + '\zh-CN.pak') and
FileExists(TempDir + '\zh-TW.pak');
except
on e : exception do
OutputDebugMessage('TCefApplication.CheckLocales error: ' + e.Message);
end;
end;
function TCefApplication.CheckResources : boolean;
var
TempDir : string;
begin
Result := False;
try
// path is hard-coded in Chromium for natives_blob.bin, snapshot_blob.bin and icudtl.dat
if FileExists('natives_blob.bin') and
FileExists('snapshot_blob.bin') and
FileExists('icudtl.dat') then
begin
if (length(FResourcesDirPath) > 0) then
begin
if DirectoryExists(FResourcesDirPath) then
begin
TempDir := FResourcesDirPath;
if (TempDir[length(TempDir)] <> '\') then TempDir := TempDir + '\';
Result := FileExists(TempDir + 'cef.pak') and
FileExists(TempDir + 'cef_100_percent.pak') and
FileExists(TempDir + 'cef_200_percent.pak') and
FileExists(TempDir + 'cef_extensions.pak') and
FileExists(TempDir + 'devtools_resources.pak');
end;
end
else
Result := FileExists('cef.pak') and
FileExists('cef_100_percent.pak') and
FileExists('cef_200_percent.pak') and
FileExists('cef_extensions.pak') and
FileExists('devtools_resources.pak');
end;
except
on e : exception do
OutputDebugMessage('TCefApplication.CheckResources error: ' + e.Message);
end;
end;
function TCefApplication.CheckDLLs : boolean;
begin
Result := False;
try
Result := FileExists('chrome_elf.dll') and
FileExists('d3dcompiler_43.dll') and
FileExists('d3dcompiler_47.dll') and
FileExists('libcef.dll') and
FileExists('libEGL.dll') and
FileExists('libGLESv2.dll') and
FileExists('widevinecdmadapter.dll');
except
on e : exception do
OutputDebugMessage('TCefApplication.CheckDLLs error: ' + e.Message);
end;
end;
function TCefApplication.CheckCEFLibrary : boolean; function TCefApplication.CheckCEFLibrary : boolean;
var var
TempVersion : uint64; TempVersion : uint64;
@@ -480,45 +617,26 @@ var
begin begin
Result := False; Result := False;
try if not(FCheckCEFFiles) then
if not(FCheckCEFFiles) then Result := True
Result := True else
else if CheckDLLs and
if FileExists('chrome_elf.dll') and CheckResources and
FileExists('d3dcompiler_43.dll') and CheckLocales then
FileExists('d3dcompiler_47.dll') and begin
FileExists('libcef.dll') and TempVersion := GetFileVersion('libcef.dll');
FileExists('libEGL.dll') and UInt64ToFileVersionInfo(TempVersion, TempVersionInfo);
FileExists('libGLESv2.dll') and
FileExists('natives_blob.bin') and
FileExists('snapshot_blob.bin') and
FileExists('widevinecdmadapter.dll') and
FileExists('cef.pak') and
FileExists('cef_100_percent.pak') and
FileExists('cef_200_percent.pak') and
FileExists('cef_extensions.pak') and
FileExists('devtools_resources.pak') and
FileExists('icudtl.dat') and
DirectoryExists('locales') and
FileExists('locales\en-US.pak') then
begin
TempVersion := GetFileVersion('libcef.dll');
UInt64ToFileVersionInfo(TempVersion, TempVersionInfo);
if (TempVersionInfo.MajorVer = CEF_SUPPORTED_VERSION_MAJOR) and if (TempVersionInfo.MajorVer = CEF_SUPPORTED_VERSION_MAJOR) and
(TempVersionInfo.MinorVer = CEF_SUPPORTED_VERSION_MINOR) and (TempVersionInfo.MinorVer = CEF_SUPPORTED_VERSION_MINOR) and
(TempVersionInfo.Release = CEF_SUPPORTED_VERSION_RELEASE) and (TempVersionInfo.Release = CEF_SUPPORTED_VERSION_RELEASE) and
(TempVersionInfo.Build = CEF_SUPPORTED_VERSION_BUILD) then (TempVersionInfo.Build = CEF_SUPPORTED_VERSION_BUILD) then
Result := True Result := True
else else
OutputDebugMessage('TCefApplication.CheckCEFLibrary error: Unsupported CEF version !'); OutputDebugMessage('TCefApplication.CheckCEFLibrary error: Unsupported CEF version !');
end end
else else
OutputDebugMessage('TCefApplication.CheckCEFLibrary error: CEF binaries missing !'); OutputDebugMessage('TCefApplication.CheckCEFLibrary error: CEF binaries missing !');
except
on e : exception do
OutputDebugMessage('TCefApplication.CheckCEFLibrary error: ' + e.Message);
end;
end; end;
procedure TCefApplication.UpdateChromeVersionInfo; procedure TCefApplication.UpdateChromeVersionInfo;
@@ -637,6 +755,8 @@ end;
procedure TCefApplication.App_OnBeforeCommandLineProc(const processType : ustring; procedure TCefApplication.App_OnBeforeCommandLineProc(const processType : ustring;
const commandLine : ICefCommandLine); const commandLine : ICefCommandLine);
var
i : integer;
begin begin
if (commandLine <> nil) then if (commandLine <> nil) then
begin begin
@@ -647,7 +767,18 @@ begin
commandLine.AppendSwitch('--enable-system-flash'); commandLine.AppendSwitch('--enable-system-flash');
end; end;
if (length(FCustomCommandLine) > 0) then commandLine.AppendSwitch(FCustomCommandLine); if (FCustomCommandLines <> nil) then
begin
i := 0;
while (i < FCustomCommandLines.Count) do
begin
if (length(FCustomCommandLines[i]) > 0) then
commandLine.AppendSwitch(FCustomCommandLines[i]);
inc(i);
end;
end;
end; end;
end; end;

View File

@@ -680,8 +680,7 @@ begin
if (FPrefs <> nil) then FreeAndNil(FPrefs); if (FPrefs <> nil) then FreeAndNil(FPrefs);
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.Destroy error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.Destroy error: ' + e.Message);
end; end;
finally finally
inherited Destroy; inherited Destroy;
@@ -703,8 +702,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.AfterConstruction error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.AfterConstruction error: ' + e.Message);
end; end;
end; end;
@@ -722,8 +720,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.CreateClientHandler error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.CreateClientHandler error: ' + e.Message);
end; end;
end; end;
@@ -868,8 +865,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.CreateBrowser error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.CreateBrowser error: ' + e.Message);
end; end;
end; end;
@@ -946,8 +942,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.VisitDOM error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.VisitDOM error: ' + e.Message);
end; end;
end; end;
@@ -1204,8 +1199,7 @@ begin
if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.MultiThreadedMessageLoop; if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.MultiThreadedMessageLoop;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.GetMultithreadApp error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.GetMultithreadApp error: ' + e.Message);
end; end;
end; end;
@@ -1634,13 +1628,12 @@ begin
Result := TempProxy.SetDictionary(TempDict) and Result := TempProxy.SetDictionary(TempDict) and
FBrowser.Host.RequestContext.SetPreference('proxy', TempProxy, TempError); FBrowser.Host.RequestContext.SetPreference('proxy', TempProxy, TempError);
if not(Result) and (GlobalCEFApp <> nil) then if not(Result) then
GlobalCEFApp.OutputDebugMessage('UpdateProxyPrefs error : ' + quotedstr(TempError)); OutputDebugMessage('TChromium.UpdateProxyPrefs error : ' + quotedstr(TempError));
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.UpdateProxyPrefs error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.UpdateProxyPrefs error: ' + e.Message);
end; end;
end; end;
@@ -1663,13 +1656,12 @@ begin
Result := FBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError); Result := FBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError);
if not(Result) and (GlobalCEFApp <> nil) then if not(Result) then
GlobalCEFApp.OutputDebugMessage('UpdatePreference error : ' + quotedstr(TempError)); OutputDebugMessage('TChromium.UpdatePreference error : ' + quotedstr(TempError));
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.UpdatePreference error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.UpdatePreference error: ' + e.Message);
end; end;
end; end;
@@ -1687,13 +1679,12 @@ begin
TempValue.SetInt(aValue); TempValue.SetInt(aValue);
Result := FBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError); Result := FBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError);
if not(Result) and (GlobalCEFApp <> nil) then if not(Result) then
GlobalCEFApp.OutputDebugMessage('UpdatePreference error : ' + quotedstr(TempError)); OutputDebugMessage('TChromium.UpdatePreference error : ' + quotedstr(TempError));
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.UpdatePreference error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.UpdatePreference error: ' + e.Message);
end; end;
end; end;
@@ -1711,13 +1702,12 @@ begin
TempValue.SetDouble(aValue); TempValue.SetDouble(aValue);
Result := FBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError); Result := FBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError);
if not(Result) and (GlobalCEFApp <> nil) then if not(Result) then
GlobalCEFApp.OutputDebugMessage('UpdatePreference error : ' + quotedstr(TempError)); OutputDebugMessage('TChromium.UpdatePreference error : ' + quotedstr(TempError));
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.UpdatePreference error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.UpdatePreference error: ' + e.Message);
end; end;
end; end;
@@ -1735,13 +1725,12 @@ begin
TempValue.SetString(aValue); TempValue.SetString(aValue);
Result := FBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError); Result := FBrowser.Host.RequestContext.SetPreference(aName, TempValue, TempError);
if not(Result) and (GlobalCEFApp <> nil) then if not(Result) then
GlobalCEFApp.OutputDebugMessage('UpdatePreference error : ' + quotedstr(TempError)); OutputDebugMessage('TChromium.UpdatePreference error : ' + quotedstr(TempError));
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.UpdatePreference error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.UpdatePreference error: ' + e.Message);
end; end;
end; end;
@@ -1965,8 +1954,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.HandleDictionary error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.HandleDictionary error: ' + e.Message);
end; end;
finally finally
if (TempKeys <> nil) then TempKeys.Free; if (TempKeys <> nil) then TempKeys.Free;
@@ -1989,8 +1977,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.GetAllPreferences error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.GetAllPreferences error: ' + e.Message);
end; end;
end; end;
@@ -2023,8 +2010,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TChromium.ExecuteJavaScript error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TChromium.ExecuteJavaScript error: ' + e.Message);
end; end;
end; end;

View File

@@ -495,18 +495,25 @@ end;
destructor TVCLClientHandler.Destroy; destructor TVCLClientHandler.Destroy;
begin begin
if not(MultithreadApp) and not(ExternalMessagePump) then try
begin try
InterlockedDecrement(CefInstances); if not(MultithreadApp) and not(ExternalMessagePump) then
if (CefInstances = 0) and (CefTimer <> 0) then
begin begin
KillTimer(0, CefTimer); InterlockedDecrement(CefInstances);
CefTimer := 0;
end;
end;
inherited Destroy; if (CefInstances = 0) and (CefTimer <> 0) then
begin
KillTimer(0, CefTimer);
CefTimer := 0;
end;
end;
except
on e : exception do
OutputDebugMessage('TVCLClientHandler.Destroy error: ' + e.Message);
end;
finally
inherited Destroy;
end;
end; end;
procedure TVCLClientHandler.ReleaseOtherInstances; procedure TVCLClientHandler.ReleaseOtherInstances;
@@ -530,8 +537,7 @@ begin
if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.MultiThreadedMessageLoop; if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.MultiThreadedMessageLoop;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TVCLClientHandler.GetMultithreadApp error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TVCLClientHandler.GetMultithreadApp error: ' + e.Message);
end; end;
end; end;
@@ -543,8 +549,7 @@ begin
if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.ExternalMessagePump; if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.ExternalMessagePump;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TVCLClientHandler.GetExternalMessagePump error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TVCLClientHandler.GetExternalMessagePump error: ' + e.Message);
end; end;
end; end;

View File

@@ -114,9 +114,14 @@ function CefCrashReportingEnabled : boolean;
procedure CefSetCrashKeyValue(const aKey, aValue : ustring); procedure CefSetCrashKeyValue(const aKey, aValue : ustring);
procedure CefLog(const aFile : string; aLine, aSeverity : integer; const aMessage : string); procedure CefLog(const aFile : string; aLine, aSeverity : integer; const aMessage : string);
procedure OutputDebugMessage(const aMessage : string);
implementation implementation
uses
uCEFConstants, uCEFApplication;
function CefColorGetA(color: TCefColor): Byte; function CefColorGetA(color: TCefColor): Byte;
begin begin
Result := (color shr 24) and $FF; Result := (color shr 24) and $FF;
@@ -432,4 +437,16 @@ begin
end; end;
end; end;
procedure OutputDebugMessage(const aMessage : string);
const
DEFAULT_LINE = 1;
begin
{$IFDEF DEBUG}
OutputDebugString(PWideChar(aMessage + chr(0)));
if (GlobalCEFApp <> nil) and GlobalCEFApp.LibLoaded then
CefLog('CEF4Delphi', DEFAULT_LINE, CEF_LOG_SEVERITY_ERROR, aMessage);
{$ENDIF}
end;
end. end.

View File

@@ -297,8 +297,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('uCEFRequestHandler.cef_request_handler_on_select_client_certificate error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('cef_request_handler_on_select_client_certificate error: ' + e.Message);
end; end;
finally finally
if (TempCertArray <> nil) then if (TempCertArray <> nil) then

View File

@@ -122,8 +122,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TCefX509CertPrincipalRef.GetStreetAddresses error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TCefX509CertPrincipalRef.GetStreetAddresses error: ' + e.Message);
end; end;
finally finally
if (TempList <> nil) then cef_string_list_free(TempList); if (TempList <> nil) then cef_string_list_free(TempList);
@@ -146,8 +145,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TCefX509CertPrincipalRef.GetOrganizationNames error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TCefX509CertPrincipalRef.GetOrganizationNames error: ' + e.Message);
end; end;
finally finally
if (TempList <> nil) then cef_string_list_free(TempList); if (TempList <> nil) then cef_string_list_free(TempList);
@@ -170,8 +168,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TCefX509CertPrincipalRef.GetOrganizationUnitNames error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TCefX509CertPrincipalRef.GetOrganizationUnitNames error: ' + e.Message);
end; end;
finally finally
if (TempList <> nil) then cef_string_list_free(TempList); if (TempList <> nil) then cef_string_list_free(TempList);
@@ -194,8 +191,7 @@ begin
end; end;
except except
on e : exception do on e : exception do
if (GlobalCEFApp <> nil) then OutputDebugMessage('TCefX509CertPrincipalRef.GetDomainComponents error: ' + e.Message);
GlobalCEFApp.OutputDebugMessage('TCefX509CertPrincipalRef.GetDomainComponents error: ' + e.Message);
end; end;
finally finally
if (TempList <> nil) then cef_string_list_free(TempList); if (TempList <> nil) then cef_string_list_free(TempList);