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

Update to CEF 3.3029.1613.g22354a9

- Update to CEF 3.3029.1613.g22354a9
- Bug fix #28
- Added missing functions in uCEFMiscFunctions.pas
- Fixed MDIBrowser app close issue.
- Changed the CustomExceptionHandler to reraise exceptions with full
trace.
This commit is contained in:
Salvador Diaz Fau
2017-05-07 18:04:05 +02:00
parent 6b84d78cfe
commit 18a9de0a94
23 changed files with 1271 additions and 271 deletions

View File

@@ -256,7 +256,16 @@
<Overwrite>true</Overwrite>
</Platform>
</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">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
@@ -570,16 +579,7 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<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="ProjectiOSDeviceResourceRules"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>

View File

@@ -1,14 +1,14 @@
[Closed Files]
File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,20,65,45,0,0,,
File_1=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFTypes.pas',0,1,289,21,334,0,0,,
File_2=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas',0,1,113,82,151,0,0,,
File_3=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFClient.pas',0,1,24,90,42,0,0,,{1
File_4=TSourceModule,'V:\dcef3-2924\src\ceflib.pas',0,1,740,1,765,0,0,,
File_5=TSourceModule,'V:\dcef3-2924\src\cefvcl.pas',0,1,818,41,832,0,0,,
File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestHandler.pas',0,1,286,9,300,0,0,,
File_7=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509CertPrincipal.pas',0,1,162,59,205,0,0,,
File_8=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFChromium.pas',0,1,1962,9,1976,0,0,,
File_9=TSourceModule,'V:\3029\include\internal\cef_ptr.h',0,1,1,1,1,0,0,,
File_0=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFApplication.pas',0,1,40,39,60,0,0,,
File_1=TSourceModule,'V:\3029\include\capi\cef_browser_capi.h',0,1,1,1,1,0,0,,
File_2=TSourceModule,'V:\3029\include\cef_browser.h',0,1,1,1,1,0,0,,
File_3=TSourceModule,'V:\3029_2\include\capi\cef_browser_capi.h',0,1,1,1,1,0,0,,
File_4=TSourceModule,'V:\3029_2\include\cef_browser.h',0,1,1,92,32,0,0,,
File_5=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFMiscFunctions.pas',0,1,886,5,982,0,0,,
File_6=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRegisterCDMCallback.pas',0,1,34,1,1,0,0,,
File_7=TSourceModule,'V:\dcef3-2924\src\ceflib.pas',0,1,11000,65,11059,0,0,,{1
File_8=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFRequestHandler.pas',0,1,290,120,300,0,0,,
File_9=TSourceModule,'C:\Users\usuario\Documents\Embarcadero\Studio\Projects\CEF4Delphi\source\uCEFX509CertPrincipal.pas',0,1,174,18,194,0,0,,
[Modules]
Module0=default.htm
@@ -40,8 +40,8 @@ BorlandEditorCodeExplorer=BorlandEditorCodeExplorer@EditWindow0
TopPanelSize=0
LeftPanelSize=0
RightPanelSize=2000
RightPanelClients=DockSite2,DockSite4
RightPanelData=00000800010100000000AA1900000000000001D00700000000000001000000004312000009000000446F636B53697465320100000000A123000009000000446F636B5369746534FFFFFFFF
RightPanelClients=DockSite2
RightPanelData=00000800010100000000AA1900000000000001D0070000000000000100000000A123000009000000446F636B5369746532FFFFFFFF
BottomPanelSize=0
BottomPanelClients=DockSite1,MessageView
BottomPanelData=0000080001020200000009000000446F636B53697465310F0000004D65737361676556696577466F726D1234000000000000022506000000000000FFFFFFFF
@@ -49,6 +49,7 @@ BottomMiddlePanelSize=0
BottomMiddlePanelClients=DockSite0,GraphDrawingModel
BottomMiddelPanelData=0000080001020200000009000000446F636B536974653010000000477261706844726177696E67566965779D1D00000000000002F306000000000000FFFFFFFF
TabDockLeftClients=PropertyInspector=0,DockSite3=1
TabDockRightClients=DockSite4=0
[View0]
CustomEditViewType=TWelcomePageView
@@ -116,11 +117,11 @@ State=0
Left=0
Top=0
Width=2000
Height=4226
Height=8868
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=4226
ClientHeight=8868
TBDockHeight=5897
LRDockWidth=2352
Dockable=1
@@ -208,8 +209,8 @@ Create=1
Visible=0
Docked=1
State=0
Left=-8
Top=-30
Left=-148
Top=-137
Width=1844
Height=3139
MaxLeft=-1
@@ -265,14 +266,14 @@ Create=1
Visible=0
Docked=1
State=0
Left=78
Top=386
Left=0
Top=362
Width=1898
Height=7164
Height=5370
MaxLeft=-1
MaxTop=-1
ClientWidth=1898
ClientHeight=7164
ClientHeight=5370
TBDockHeight=7164
LRDockWidth=1898
Dockable=1
@@ -288,11 +289,11 @@ State=0
Left=0
Top=0
Width=2000
Height=6816
Height=6861
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=6816
ClientHeight=6861
TBDockHeight=5964
LRDockWidth=2508
Dockable=1
@@ -304,8 +305,8 @@ Create=1
Visible=0
Docked=1
State=0
Left=-946
Top=1
Left=-898
Top=-137
Width=2844
Height=6200
MaxLeft=-1
@@ -323,8 +324,8 @@ Create=1
Visible=0
Docked=1
State=0
Left=-1152
Top=243
Left=-1026
Top=-137
Width=273
Height=359
MaxLeft=-1
@@ -428,11 +429,11 @@ State=0
Left=0
Top=0
Width=2336
Height=942
Height=1177
MaxLeft=-1
MaxTop=-1
ClientWidth=2336
ClientHeight=942
ClientHeight=1177
TBDockHeight=2321
LRDockWidth=2820
Dockable=1
@@ -493,11 +494,11 @@ State=0
Left=0
Top=0
Width=2000
Height=6816
Height=6861
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=6816
ClientHeight=6861
TBDockHeight=4888
LRDockWidth=7148
Dockable=1
@@ -509,8 +510,8 @@ Create=1
Visible=0
Docked=1
State=0
Left=249
Top=709
Left=0
Top=0
Width=2859
Height=3206
MaxLeft=-1
@@ -556,12 +557,12 @@ Docked=1
State=0
Left=0
Top=0
Width=1773
Height=6738
Width=1898
Height=9170
MaxLeft=-1
MaxTop=-1
ClientWidth=1773
ClientHeight=6738
ClientWidth=1898
ClientHeight=9170
TBDockHeight=3677
LRDockWidth=1898
Dockable=1
@@ -576,11 +577,11 @@ State=0
Left=0
Top=0
Width=2000
Height=6816
Height=6861
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=6816
ClientHeight=6861
TBDockHeight=4888
LRDockWidth=5305
Dockable=1
@@ -641,7 +642,7 @@ Visible=0
Docked=1
State=0
Left=0
Top=23
Top=0
Width=3820
Height=1424
MaxLeft=-1
@@ -667,12 +668,12 @@ State=0
Left=0
Top=23
Width=2000
Height=4529
Height=9170
MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=4529
TBDockHeight=7119
ClientHeight=9170
TBDockHeight=7164
LRDockWidth=2000
Dockable=1
StayOnTop=0
@@ -689,13 +690,13 @@ Visible=0
Docked=1
State=0
Left=0
Top=0
Top=23
Width=1898
Height=7164
Height=9170
MaxLeft=-1
MaxTop=-1
ClientWidth=1773
ClientHeight=6738
ClientWidth=1898
ClientHeight=9170
TBDockHeight=7164
LRDockWidth=1898
Dockable=1
@@ -705,11 +706,11 @@ ActiveTabID=StructureView
TabDockClients=StructureView,ClassBrowserTool
[DockSite4]
HostDockSite=DockRightPanel
HostDockSite=RightTabDock
DockSiteType=1
PercentageSizes=1
Create=1
Visible=1
Visible=0
Docked=1
State=0
Left=0
@@ -720,7 +721,7 @@ MaxLeft=-1
MaxTop=-1
ClientWidth=2000
ClientHeight=4339
TBDockHeight=7119
TBDockHeight=7164
LRDockWidth=2000
Dockable=1
StayOnTop=0

Binary file not shown.

View File

@@ -1,9 +1,9 @@
[Stats]
EditorSecs=75774
EditorSecs=77981
DesignerSecs=14
InspectorSecs=11
CompileSecs=1995488
OtherSecs=7574
CompileSecs=2032399
OtherSecs=7762
StartTime=22/01/2017 10:49:52
RealKeys=0
EffectiveKeys=0

View File

@@ -57,7 +57,7 @@ uses
const
CEF_SUPPORTED_VERSION_MAJOR = 3;
CEF_SUPPORTED_VERSION_MINOR = 3029;
CEF_SUPPORTED_VERSION_RELEASE = 1611;
CEF_SUPPORTED_VERSION_RELEASE = 1613;
CEF_SUPPORTED_VERSION_BUILD = 0;
CEF_CHROMEELF_VERSION_MAJOR = 58;
@@ -435,7 +435,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TCefApplication.CreateInternalApp error: ' + e.Message);
if CustomExceptionHandler('TCefApplication.CreateInternalApp', e) then raise;
end;
end;
@@ -453,7 +453,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TCefApplication.MultiExeProcessing error: ' + e.Message);
if CustomExceptionHandler('TCefApplication.MultiExeProcessing', e) then raise;
end;
end;
@@ -472,7 +472,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TCefApplication.SingleExeProcessing error: ' + e.Message);
if CustomExceptionHandler('TCefApplication.SingleExeProcessing', e) then raise;
end;
end;
@@ -584,7 +584,7 @@ begin
(ExecuteProcess >= 0);
except
on e : exception do
CustomExceptionHandler('TCefApplication.StartSubProcess error: ' + e.Message);
if CustomExceptionHandler('TCefApplication.StartSubProcess', e) then raise;
end;
end;
@@ -600,7 +600,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TCefApplication.ShutDown error: ' + e.Message);
if CustomExceptionHandler('TCefApplication.ShutDown', e) then raise;
end;
end;
@@ -657,7 +657,7 @@ begin
Result := (cef_initialize(@HInstance, @FAppSettings, FApp.Wrap, FWindowsSandboxInfo) <> 0);
except
on e : exception do
CustomExceptionHandler('TCefApplication.InitializeLibrary error: ' + e.Message);
if CustomExceptionHandler('TCefApplication.InitializeLibrary', e) then raise;
end;
end;
@@ -693,7 +693,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TCefApplication.DeleteDirContents error: ' + e.Message);
if CustomExceptionHandler('TCefApplication.DeleteDirContents', e) then raise;
end;
end;
@@ -1392,7 +1392,7 @@ begin
TCefAppOwn(CefGetObject(self)).OnRegisterCustomSchemes(TempWrapper);
except
on e : exception do
CustomExceptionHandler('cef_app_on_register_custom_schemes error: ' + e.Message);
if CustomExceptionHandler('cef_app_on_register_custom_schemes', e) then raise;
end;
finally
if (TempWrapper <> nil) then FreeAndNil(TempWrapper);

View File

@@ -684,7 +684,7 @@ begin
if (FPDFPrintOptions <> nil) then FreeAndNil(FPDFPrintOptions);
except
on e : exception do
CustomExceptionHandler('TChromium.Destroy error: ' + e.Message);
if CustomExceptionHandler('TChromium.Destroy', e) then raise;
end;
finally
inherited Destroy;
@@ -705,7 +705,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.AfterConstruction error: ' + e.Message);
if CustomExceptionHandler('TChromium.AfterConstruction', e) then raise;
end;
end;
@@ -723,7 +723,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.CreateClientHandler error: ' + e.Message);
if CustomExceptionHandler('TChromium.CreateClientHandler', e) then raise;
end;
end;
@@ -865,7 +865,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.CreateBrowser error: ' + e.Message);
if CustomExceptionHandler('TChromium.CreateBrowser', e) then raise;
end;
end;
@@ -1179,7 +1179,7 @@ begin
if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.MultiThreadedMessageLoop;
except
on e : exception do
CustomExceptionHandler('TChromium.GetMultithreadApp error: ' + e.Message);
if CustomExceptionHandler('TChromium.GetMultithreadApp', e) then raise;
end;
end;
@@ -1627,7 +1627,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.UpdateProxyPrefs error: ' + e.Message);
if CustomExceptionHandler('TChromium.UpdateProxyPrefs', e) then raise;
end;
end;
@@ -1655,7 +1655,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.UpdatePreference error: ' + e.Message);
if CustomExceptionHandler('TChromium.UpdatePreference', e) then raise;
end;
end;
@@ -1678,7 +1678,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.UpdatePreference error: ' + e.Message);
if CustomExceptionHandler('TChromium.UpdatePreference', e) then raise;
end;
end;
@@ -1701,7 +1701,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.UpdatePreference error: ' + e.Message);
if CustomExceptionHandler('TChromium.UpdatePreference', e) then raise;
end;
end;
@@ -1724,7 +1724,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.UpdatePreference error: ' + e.Message);
if CustomExceptionHandler('TChromium.UpdatePreference', e) then raise;
end;
end;
@@ -1948,7 +1948,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.HandleDictionary error: ' + e.Message);
if CustomExceptionHandler('TChromium.HandleDictionary', e) then raise;
end;
finally
if (TempKeys <> nil) then TempKeys.Free;
@@ -1974,7 +1974,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.Internal_SavePreferences error: ' + e.Message);
if CustomExceptionHandler('TChromium.Internal_SavePreferences', e) then raise;
end;
finally
if (TempPrefs <> nil) then FreeAndNil(TempPrefs);
@@ -2010,7 +2010,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TChromium.ExecuteJavaScript error: ' + e.Message);
if CustomExceptionHandler('TChromium.ExecuteJavaScript', e) then raise;
end;
end;

View File

@@ -518,7 +518,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('TVCLClientHandler.Destroy error: ' + e.Message);
if CustomExceptionHandler('TVCLClientHandler.Destroy', e) then raise;
end;
finally
inherited Destroy;
@@ -546,7 +546,7 @@ begin
if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.MultiThreadedMessageLoop;
except
on e : exception do
CustomExceptionHandler('TVCLClientHandler.GetMultithreadApp error: ' + e.Message);
if CustomExceptionHandler('TVCLClientHandler.GetMultithreadApp', e) then raise;
end;
end;
@@ -558,7 +558,7 @@ begin
if (GlobalCEFApp <> nil) then Result := GlobalCEFApp.ExternalMessagePump;
except
on e : exception do
CustomExceptionHandler('TVCLClientHandler.GetExternalMessagePump error: ' + e.Message);
if CustomExceptionHandler('TVCLClientHandler.GetExternalMessagePump', e) then raise;
end;
end;

View File

@@ -73,8 +73,8 @@ function CefInt64Set(int32_low, int32_high: Integer): Int64;
function CefInt64GetLow(const int64_val: Int64): Integer;
function CefInt64GetHigh(const int64_val: Int64): Integer;
function CefGetObject(ptr: Pointer): TObject;
function CefGetData(const i: ICefBaseRefCounted): Pointer;
function CefGetObject(ptr: Pointer): TObject; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
function CefGetData(const i: ICefBaseRefCounted): Pointer; {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF}
function CefStringAlloc(const str: ustring): TCefString;
function CefStringClearAndGet(var str: TCefString): ustring;
@@ -120,7 +120,7 @@ procedure CefSetCrashKeyValue(const aKey, aValue : ustring);
procedure CefLog(const aFile : string; aLine, aSeverity : integer; const aMessage : string);
procedure OutputDebugMessage(const aMessage : string);
procedure CustomExceptionHandler(const aMessage : string);
function CustomExceptionHandler(const aFunctionName : string; const aException : exception) : boolean;
function CefRegisterSchemeHandlerFactory(const SchemeName, HostName: ustring; const handler: TCefResourceHandlerClass): Boolean;
function CefClearSchemeHandlerFactories : boolean;
@@ -138,12 +138,36 @@ function CheckResources(const aResourcesDirPath : string) : boolean;
function CheckDLLs(const aFrameworkDirPath : string) : boolean;
function CheckDLLVersion(const aDLLFile : string; aMajor, aMinor, aRelease, aBuild : uint16) : boolean;
function CefParseUrl(const url: ustring; var parts: TUrlParts): Boolean;
function CefParseUrl(const url: ustring; var parts: TUrlParts): Boolean;
function CefCreateUrl(var parts: TUrlParts): ustring;
function CefFormatUrlForSecurityDisplay(const originUrl: string): string;
function CefGetMimeType(const extension: ustring): ustring;
procedure CefGetExtensionsForMimeType(const mimeType: ustring; extensions: TStringList);
function CefBase64Encode(const data: Pointer; dataSize: NativeUInt): ustring;
function CefBase64Decode(const data: ustring): ICefBinaryValue;
function CefUriEncode(const text: ustring; usePlus: Boolean): ustring;
function CefUriDecode(const text: ustring; convertToUtf8: Boolean; unescapeRule: TCefUriUnescapeRule): ustring;
function CefParseJson(const jsonString: ustring; options: TCefJsonParserOptions): ICefValue;
function CefParseJsonAndReturnError(const jsonString : ustring;
options : TCefJsonParserOptions;
out errorCodeOut : TCefJsonParserError;
out errorMsgOut : ustring): ICefValue;
function CefWriteJson(const node: ICefValue; options: TCefJsonWriterOptions): ustring;
function CefCreateDirectory(const fullPath: ustring): Boolean;
function CefGetTempDirectory(out tempDir: ustring): Boolean;
function CefCreateNewTempDirectory(const prefix: ustring; out newTempPath: ustring): Boolean;
function CefCreateTempDirectoryInDirectory(const baseDir, prefix: ustring; out newDir: ustring): Boolean;
function CefDirectoryExists(const path: ustring): Boolean;
function CefDeleteFile(const path: ustring; recursive: Boolean): Boolean;
function CefZipDirectory(const srcDir, destFile: ustring; includeHiddenFiles: Boolean): Boolean;
implementation
uses
uCEFConstants, uCEFApplication, uCEFSchemeHandlerFactory;
uCEFConstants, uCEFApplication, uCEFSchemeHandlerFactory, uCEFValue, uCEFBinaryValue;
function CefColorGetA(color: TCefColor): Byte;
begin
@@ -469,12 +493,11 @@ begin
{$ENDIF}
end;
procedure CustomExceptionHandler(const aMessage : string);
function CustomExceptionHandler(const aFunctionName : string; const aException : exception) : boolean;
begin
OutputDebugMessage(aMessage);
OutputDebugMessage(aFunctionName + ' error : ' + aException.message);
if (GlobalCEFApp <> nil) and GlobalCEFApp.ReRaiseExceptions then
raise Exception.Create(aMessage);
Result := (GlobalCEFApp <> nil) and GlobalCEFApp.ReRaiseExceptions;
end;
function CefRegisterSchemeHandlerFactory(const SchemeName : ustring;
@@ -604,7 +627,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('CheckLocales error: ' + e.Message);
if CustomExceptionHandler('CheckLocales', e) then raise;
end;
end;
@@ -638,7 +661,7 @@ begin
FileExists(TempDir + 'devtools_resources.pak');
except
on e : exception do
CustomExceptionHandler('CheckResources error: ' + e.Message);
if CustomExceptionHandler('CheckResources', e) then raise;
end;
end;
@@ -671,7 +694,7 @@ begin
FileExists(TempDir + 'widevinecdmadapter.dll');
except
on e : exception do
CustomExceptionHandler('CheckDLLs error: ' + e.Message);
if CustomExceptionHandler('CheckDLLs', e) then raise;
end;
end;
@@ -712,7 +735,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('GetExtendedFileVersion error: ' + e.Message);
if CustomExceptionHandler('GetExtendedFileVersion', e) then raise;
end;
finally
if (TempBuffer <> nil) then FreeMem(TempBuffer);
@@ -734,7 +757,7 @@ begin
end;
except
on e : exception do
CustomExceptionHandler('GetDLLVersion error: ' + e.Message);
if CustomExceptionHandler('GetDLLVersion', e) then raise;
end;
end;
@@ -780,4 +803,182 @@ begin
end;
end;
function CefCreateUrl(var parts: TUrlParts): ustring;
var
p: TCefUrlParts;
u: TCefString;
begin
FillChar(p, sizeof(p), 0);
p.spec := CefString(parts.spec);
p.scheme := CefString(parts.scheme);
p.username := CefString(parts.username);
p.password := CefString(parts.password);
p.host := CefString(parts.host);
p.port := CefString(parts.port);
p.origin := CefString(parts.origin);
p.path := CefString(parts.path);
p.query := CefString(parts.query);
FillChar(u, SizeOf(u), 0);
if cef_create_url(@p, @u) <> 0 then
Result := CefString(@u) else
Result := '';
end;
function CefFormatUrlForSecurityDisplay(const originUrl: string): string;
var
o: TCefString;
begin
o := CefString(originUrl);
Result := CefStringFreeAndGet(cef_format_url_for_security_display(@o));
end;
function CefGetMimeType(const extension: ustring): ustring;
var
s: TCefString;
begin
s := CefString(extension);
Result := CefStringFreeAndGet(cef_get_mime_type(@s));
end;
procedure CefGetExtensionsForMimeType(const mimeType: ustring; extensions: TStringList);
var
list: TCefStringList;
s, str: TCefString;
i: Integer;
begin
list := cef_string_list_alloc();
try
s := CefString(mimeType);
cef_get_extensions_for_mime_type(@s, list);
for i := 0 to cef_string_list_size(list) - 1 do
begin
FillChar(str, SizeOf(str), 0);
cef_string_list_value(list, i, @str);
extensions.Add(CefStringClearAndGet(str));
end;
finally
cef_string_list_free(list);
end;
end;
function CefBase64Encode(const data: Pointer; dataSize: NativeUInt): ustring;
begin
Result:= CefStringFreeAndGet(cef_base64encode(data, dataSize));
end;
function CefBase64Decode(const data: ustring): ICefBinaryValue;
var
s: TCefString;
begin
s := CefString(data);
Result := TCefBinaryValueRef.UnWrap(cef_base64decode(@s));
end;
function CefUriEncode(const text: ustring; usePlus: Boolean): ustring;
var
s: TCefString;
begin
s := CefString(text);
Result := CefStringFreeAndGet(cef_uriencode(@s, Ord(usePlus)));
end;
function CefUriDecode(const text: ustring; convertToUtf8: Boolean;
unescapeRule: TCefUriUnescapeRule): ustring;
var
s: TCefString;
begin
s := CefString(text);
Result := CefStringFreeAndGet(cef_uridecode(@s, Ord(convertToUtf8), unescapeRule));
end;
function CefParseJson(const jsonString: ustring; options: TCefJsonParserOptions): ICefValue;
var
s: TCefString;
begin
s := CefString(jsonString);
Result := TCefValueRef.UnWrap(cef_parse_json(@s, options));
end;
function CefParseJsonAndReturnError(const jsonString : ustring;
options : TCefJsonParserOptions;
out errorCodeOut : TCefJsonParserError;
out errorMsgOut : ustring): ICefValue;
var
s, e: TCefString;
begin
s := CefString(jsonString);
FillChar(e, SizeOf(e), 0);
Result := TCefValueRef.UnWrap(cef_parse_jsonand_return_error(@s, options, @errorCodeOut, @e));
errorMsgOut := CefString(@e);
end;
function CefWriteJson(const node: ICefValue; options: TCefJsonWriterOptions): ustring;
begin
Result := CefStringFreeAndGet(cef_write_json(CefGetData(node), options));
end;
function CefCreateDirectory(const fullPath: ustring): Boolean;
var
path: TCefString;
begin
path := CefString(fullPath);
Result := cef_create_directory(@path) <> 0;
end;
function CefGetTempDirectory(out tempDir: ustring): Boolean;
var
path: TCefString;
begin
FillChar(path, SizeOf(path), 0);
Result := cef_get_temp_directory(@path) <> 0;
tempDir := CefString(@path);
end;
function CefCreateNewTempDirectory(const prefix: ustring; out newTempPath: ustring): Boolean;
var
path, pref: TCefString;
begin
FillChar(path, SizeOf(path), 0);
pref := CefString(prefix);
Result := cef_create_new_temp_directory(@pref, @path) <> 0;
newTempPath := CefString(@path);
end;
function CefCreateTempDirectoryInDirectory(const baseDir, prefix: ustring;
out newDir: ustring): Boolean;
var
base, path, pref: TCefString;
begin
FillChar(path, SizeOf(path), 0);
pref := CefString(prefix);
base := CefString(baseDir);
Result := cef_create_temp_directory_in_directory(@base, @pref, @path) <> 0;
newDir := CefString(@path);
end;
function CefDirectoryExists(const path: ustring): Boolean;
var
str: TCefString;
begin
str := CefString(path);
Result := cef_directory_exists(@str) <> 0;
end;
function CefDeleteFile(const path: ustring; recursive: Boolean): Boolean;
var
str: TCefString;
begin
str := CefString(path);
Result := cef_delete_file(@str, Ord(recursive)) <> 0;
end;
function CefZipDirectory(const srcDir, destFile: ustring; includeHiddenFiles: Boolean): Boolean;
var
src, dst: TCefString;
begin
src := CefString(srcDir);
dst := CefString(destFile);
Result := cef_zip_directory(@src, @dst, Ord(includeHiddenFiles)) <> 0;
end;
end.

View File

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

View File

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