mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-02-02 10:25:26 +02:00
Update to CEF 3.3239.1710.g85f637a
Fixed an initialization bug in MDIBrowser, TabBrowser and ToolBoxBrowser Added several procedures to clear interface and class references before destruction
This commit is contained in:
parent
984c87cc03
commit
9c9a9f59c7
@ -183,7 +183,6 @@ procedure TJSDialogBrowserFrm.ChromiumBrowser_OnJsdialog(Sender : TObject;
|
|||||||
out Result : Boolean);
|
out Result : Boolean);
|
||||||
begin
|
begin
|
||||||
// In this event we must store the dialog information and post a message to the main form to show the dialog
|
// In this event we must store the dialog information and post a message to the main form to show the dialog
|
||||||
|
|
||||||
FJSDialogInfoCS.Acquire;
|
FJSDialogInfoCS.Acquire;
|
||||||
|
|
||||||
if FPendingDlg then
|
if FPendingDlg then
|
||||||
|
@ -106,7 +106,8 @@ uses
|
|||||||
|
|
||||||
procedure GlobalCEFApp_OnContextInitialized;
|
procedure GlobalCEFApp_OnContextInitialized;
|
||||||
begin
|
begin
|
||||||
if (MainForm <> nil) then PostMessage(MainForm.Handle, CEFBROWSER_INITIALIZED, 0, 0);
|
if (MainForm <> nil) and MainForm.HandleAllocated then
|
||||||
|
PostMessage(MainForm.Handle, CEFBROWSER_INITIALIZED, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.CreateMDIChild(const Name: string);
|
procedure TMainForm.CreateMDIChild(const Name: string);
|
||||||
|
@ -135,7 +135,8 @@ implementation
|
|||||||
|
|
||||||
procedure GlobalCEFApp_OnContextInitialized;
|
procedure GlobalCEFApp_OnContextInitialized;
|
||||||
begin
|
begin
|
||||||
if (MainForm <> nil) then PostMessage(MainForm.Handle, CEFBROWSER_INITIALIZED, 0, 0);
|
if (MainForm <> nil) and MainForm.HandleAllocated then
|
||||||
|
PostMessage(MainForm.Handle, CEFBROWSER_INITIALIZED, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.AddTabBtnClick(Sender: TObject);
|
procedure TMainForm.AddTabBtnClick(Sender: TObject);
|
||||||
|
@ -104,7 +104,8 @@ uses
|
|||||||
|
|
||||||
procedure GlobalCEFApp_OnContextInitialized;
|
procedure GlobalCEFApp_OnContextInitialized;
|
||||||
begin
|
begin
|
||||||
if (MainForm <> nil) then PostMessage(MainForm.Handle, CEFBROWSER_INITIALIZED, 0, 0);
|
if (MainForm <> nil) and MainForm.HandleAllocated then
|
||||||
|
PostMessage(MainForm.Handle, CEFBROWSER_INITIALIZED, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.CreateToolboxChild(const ChildCaption, URL: string);
|
procedure TMainForm.CreateToolboxChild(const ChildCaption, URL: string);
|
||||||
|
@ -57,15 +57,20 @@ type
|
|||||||
FBuffer : TBitmap;
|
FBuffer : TBitmap;
|
||||||
FScanlineSize : integer;
|
FScanlineSize : integer;
|
||||||
|
|
||||||
|
procedure CreateBufferMutex;
|
||||||
|
|
||||||
|
procedure DestroyBufferMutex;
|
||||||
|
procedure DestroyBuffer;
|
||||||
|
|
||||||
function GetBufferBits : pointer;
|
function GetBufferBits : pointer;
|
||||||
function GetBufferWidth : integer;
|
function GetBufferWidth : integer;
|
||||||
function GetBufferHeight : integer;
|
function GetBufferHeight : integer;
|
||||||
|
|
||||||
function CopyBuffer(aDC : HDC; const aRect : TRect) : boolean;
|
function CopyBuffer : boolean;
|
||||||
function SaveBufferToFile(const aFilename : string) : boolean;
|
function SaveBufferToFile(const aFilename : string) : boolean;
|
||||||
procedure DestroyBuffer;
|
|
||||||
|
|
||||||
procedure WMPaint(var aMessage: TWMPaint); message WM_PAINT;
|
procedure Paint; override;
|
||||||
|
|
||||||
procedure WMEraseBkgnd(var aMessage : TWMEraseBkgnd); message WM_ERASEBKGND;
|
procedure WMEraseBkgnd(var aMessage : TWMEraseBkgnd); message WM_ERASEBKGND;
|
||||||
|
|
||||||
public
|
public
|
||||||
@ -73,7 +78,7 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure AfterConstruction; override;
|
procedure AfterConstruction; override;
|
||||||
function SaveToFile(const aFilename : string) : boolean;
|
function SaveToFile(const aFilename : string) : boolean;
|
||||||
procedure InvalidatePanel;
|
function InvalidatePanel : boolean;
|
||||||
function BeginBufferDraw : boolean;
|
function BeginBufferDraw : boolean;
|
||||||
procedure EndBufferDraw;
|
procedure EndBufferDraw;
|
||||||
procedure BufferDraw(x, y : integer; const aBitmap : TBitmap);
|
procedure BufferDraw(x, y : integer; const aBitmap : TBitmap);
|
||||||
@ -187,12 +192,7 @@ end;
|
|||||||
destructor TBufferPanel.Destroy;
|
destructor TBufferPanel.Destroy;
|
||||||
begin
|
begin
|
||||||
DestroyBuffer;
|
DestroyBuffer;
|
||||||
|
DestroyBufferMutex;
|
||||||
if (FMutex <> 0) then
|
|
||||||
begin
|
|
||||||
CloseHandle(FMutex);
|
|
||||||
FMutex := 0;
|
|
||||||
end;
|
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
@ -201,9 +201,23 @@ procedure TBufferPanel.AfterConstruction;
|
|||||||
begin
|
begin
|
||||||
inherited AfterConstruction;
|
inherited AfterConstruction;
|
||||||
|
|
||||||
|
CreateBufferMutex;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TBufferPanel.CreateBufferMutex;
|
||||||
|
begin
|
||||||
FMutex := CreateMutex(nil, False, nil);
|
FMutex := CreateMutex(nil, False, nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TBufferPanel.DestroyBufferMutex;
|
||||||
|
begin
|
||||||
|
if (FMutex <> 0) then
|
||||||
|
begin
|
||||||
|
CloseHandle(FMutex);
|
||||||
|
FMutex := 0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TBufferPanel.DestroyBuffer;
|
procedure TBufferPanel.DestroyBuffer;
|
||||||
begin
|
begin
|
||||||
if BeginBufferDraw then
|
if BeginBufferDraw then
|
||||||
@ -231,18 +245,18 @@ end;
|
|||||||
|
|
||||||
function TBufferPanel.SaveToFile(const aFilename : string) : boolean;
|
function TBufferPanel.SaveToFile(const aFilename : string) : boolean;
|
||||||
begin
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
if BeginBufferDraw then
|
if BeginBufferDraw then
|
||||||
begin
|
begin
|
||||||
Result := SaveBufferToFile(aFilename);
|
Result := SaveBufferToFile(aFilename);
|
||||||
EndBufferDraw;
|
EndBufferDraw;
|
||||||
end
|
end;
|
||||||
else
|
|
||||||
Result := False;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBufferPanel.InvalidatePanel;
|
function TBufferPanel.InvalidatePanel : boolean;
|
||||||
begin
|
begin
|
||||||
PostMessage(Handle, CM_INVALIDATE, 0, 0);
|
Result := HandleAllocated and PostMessage(Handle, CM_INVALIDATE, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBufferPanel.BeginBufferDraw : boolean;
|
function TBufferPanel.BeginBufferDraw : boolean;
|
||||||
@ -255,50 +269,39 @@ begin
|
|||||||
if (FMutex <> 0) then ReleaseMutex(FMutex);
|
if (FMutex <> 0) then ReleaseMutex(FMutex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBufferPanel.CopyBuffer(aDC : HDC; const aRect : TRect) : boolean;
|
function TBufferPanel.CopyBuffer : boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
if BeginBufferDraw then
|
if BeginBufferDraw then
|
||||||
begin
|
begin
|
||||||
Result := (FBuffer <> nil) and
|
Result := (FBuffer <> nil) and
|
||||||
(aDC <> 0) and
|
BitBlt(Canvas.Handle, 0, 0, Width, Height,
|
||||||
BitBlt(aDC, aRect.Left, aRect.Top, aRect.Right - aRect.Left, aRect.Bottom - aRect.Top,
|
FBuffer.Canvas.Handle, 0, 0,
|
||||||
FBuffer.Canvas.Handle, aRect.Left, aRect.Top,
|
|
||||||
SrcCopy);
|
SrcCopy);
|
||||||
|
|
||||||
EndBufferDraw;
|
EndBufferDraw;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBufferPanel.WMPaint(var aMessage: TWMPaint);
|
procedure TBufferPanel.Paint;
|
||||||
var
|
|
||||||
TempPaintStruct : TPaintStruct;
|
|
||||||
TempDC : HDC;
|
|
||||||
begin
|
begin
|
||||||
try
|
if csDesigning in ComponentState then
|
||||||
TempDC := BeginPaint(Handle, TempPaintStruct);
|
begin
|
||||||
|
Canvas.Font.Assign(Font);
|
||||||
|
Canvas.Brush.Color := Color;
|
||||||
|
Canvas.Brush.Style := bsSolid;
|
||||||
|
Canvas.Pen.Style := psDash;
|
||||||
|
|
||||||
if csDesigning in ComponentState then
|
Canvas.Rectangle(0, 0, Width, Height);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not(CopyBuffer) then
|
||||||
begin
|
begin
|
||||||
Canvas.Font.Assign(Font);
|
|
||||||
Canvas.Brush.Color := Color;
|
Canvas.Brush.Color := Color;
|
||||||
Canvas.Brush.Style := bsSolid;
|
Canvas.Brush.Style := bsSolid;
|
||||||
Canvas.Pen.Style := psDash;
|
Canvas.FillRect(rect(0, 0, Width, Height));
|
||||||
|
end;
|
||||||
Canvas.Rectangle(0, 0, Width, Height);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if not(CopyBuffer(TempDC, TempPaintStruct.rcPaint)) then
|
|
||||||
begin
|
|
||||||
Canvas.Brush.Color := Color;
|
|
||||||
Canvas.Brush.Style := bsSolid;
|
|
||||||
Canvas.FillRect(rect(0, 0, Width, Height));
|
|
||||||
end;
|
|
||||||
finally
|
|
||||||
EndPaint(Handle, TempPaintStruct);
|
|
||||||
aMessage.Result := 1;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBufferPanel.WMEraseBkgnd(var aMessage : TWMEraseBkgnd);
|
procedure TBufferPanel.WMEraseBkgnd(var aMessage : TWMEraseBkgnd);
|
||||||
@ -337,6 +340,8 @@ end;
|
|||||||
|
|
||||||
function TBufferPanel.UpdateBufferDimensions(aWidth, aHeight : integer) : boolean;
|
function TBufferPanel.UpdateBufferDimensions(aWidth, aHeight : integer) : boolean;
|
||||||
begin
|
begin
|
||||||
|
Result := False;
|
||||||
|
|
||||||
if ((FBuffer = nil) or
|
if ((FBuffer = nil) or
|
||||||
(FBuffer.Width <> aWidth) or
|
(FBuffer.Width <> aWidth) or
|
||||||
(FBuffer.Height <> aHeight)) then
|
(FBuffer.Height <> aHeight)) then
|
||||||
@ -350,9 +355,7 @@ begin
|
|||||||
FBuffer.Height := aHeight;
|
FBuffer.Height := aHeight;
|
||||||
FScanlineSize := FBuffer.Width * SizeOf(TRGBQuad);
|
FScanlineSize := FBuffer.Width * SizeOf(TRGBQuad);
|
||||||
Result := True;
|
Result := True;
|
||||||
end
|
end;
|
||||||
else
|
|
||||||
Result := False;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBufferPanel.BufferIsResized(aUseMutex : boolean) : boolean;
|
function TBufferPanel.BufferIsResized(aUseMutex : boolean) : boolean;
|
||||||
|
@ -57,7 +57,7 @@ uses
|
|||||||
const
|
const
|
||||||
CEF_SUPPORTED_VERSION_MAJOR = 3;
|
CEF_SUPPORTED_VERSION_MAJOR = 3;
|
||||||
CEF_SUPPORTED_VERSION_MINOR = 3239;
|
CEF_SUPPORTED_VERSION_MINOR = 3239;
|
||||||
CEF_SUPPORTED_VERSION_RELEASE = 1709;
|
CEF_SUPPORTED_VERSION_RELEASE = 1710;
|
||||||
CEF_SUPPORTED_VERSION_BUILD = 0;
|
CEF_SUPPORTED_VERSION_BUILD = 0;
|
||||||
|
|
||||||
CEF_CHROMEELF_VERSION_MAJOR = 63;
|
CEF_CHROMEELF_VERSION_MAJOR = 63;
|
||||||
@ -230,6 +230,7 @@ type
|
|||||||
function FindFlashDLL(var aFileName : string) : boolean;
|
function FindFlashDLL(var aFileName : string) : boolean;
|
||||||
procedure ShowErrorMessageDlg(const aError : string); virtual;
|
procedure ShowErrorMessageDlg(const aError : string); virtual;
|
||||||
function ParseProcessType : TCefProcessType;
|
function ParseProcessType : TCefProcessType;
|
||||||
|
procedure RemoveAppReferences;
|
||||||
procedure CreateAppHandlers;
|
procedure CreateAppHandlers;
|
||||||
|
|
||||||
public
|
public
|
||||||
@ -496,6 +497,8 @@ destructor TCefApplication.Destroy;
|
|||||||
begin
|
begin
|
||||||
if FMustShutDown then ShutDown;
|
if FMustShutDown then ShutDown;
|
||||||
|
|
||||||
|
RemoveAppReferences;
|
||||||
|
|
||||||
if (FLibHandle <> 0) then
|
if (FLibHandle <> 0) then
|
||||||
begin
|
begin
|
||||||
FreeLibrary(FLibHandle);
|
FreeLibrary(FLibHandle);
|
||||||
@ -511,6 +514,18 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefApplication.RemoveAppReferences;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
if (FResourceBundleHandler <> nil) then FResourceBundleHandler.InitializeVars;
|
||||||
|
if (FBrowserProcessHandler <> nil) then FBrowserProcessHandler.InitializeVars;
|
||||||
|
if (FRenderProcessHandler <> nil) then FRenderProcessHandler.InitializeVars;
|
||||||
|
except
|
||||||
|
on e : exception do
|
||||||
|
if CustomExceptionHandler('TCefApplication.RemoveAppReferences', e) then raise;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefApplication.AfterConstruction;
|
procedure TCefApplication.AfterConstruction;
|
||||||
begin
|
begin
|
||||||
inherited AfterConstruction;
|
inherited AfterConstruction;
|
||||||
|
@ -58,23 +58,26 @@ type
|
|||||||
function GetPrintHandler : ICefPrintHandler; virtual;
|
function GetPrintHandler : ICefPrintHandler; virtual;
|
||||||
procedure OnScheduleMessagePumpWork(const delayMs: Int64); virtual; abstract;
|
procedure OnScheduleMessagePumpWork(const delayMs: Int64); virtual; abstract;
|
||||||
|
|
||||||
|
procedure InitializeVars; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCefCustomBrowserProcessHandler = class(TCefBrowserProcessHandlerOwn)
|
TCefCustomBrowserProcessHandler = class(TCefBrowserProcessHandlerOwn)
|
||||||
protected
|
protected
|
||||||
FCefApp : TCefApplication;
|
FCefApp : TCefApplication;
|
||||||
|
|
||||||
procedure OnContextInitialized; override;
|
procedure OnContextInitialized; override;
|
||||||
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); override;
|
procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); override;
|
||||||
procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue); override;
|
procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue); override;
|
||||||
procedure OnScheduleMessagePumpWork(const delayMs: Int64); override;
|
procedure OnScheduleMessagePumpWork(const delayMs: Int64); override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
end;
|
procedure InitializeVars; override;
|
||||||
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -85,8 +88,8 @@ procedure cef_browser_process_handler_on_context_initialized(self: PCefBrowserPr
|
|||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
begin
|
begin
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
||||||
TCefBrowserProcessHandlerOwn(TempObject).OnContextInitialized;
|
TCefBrowserProcessHandlerOwn(TempObject).OnContextInitialized;
|
||||||
end;
|
end;
|
||||||
@ -96,8 +99,8 @@ procedure cef_browser_process_handler_on_before_child_process_launch(self
|
|||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
begin
|
begin
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
||||||
TCefBrowserProcessHandlerOwn(TempObject).OnBeforeChildProcessLaunch(TCefCommandLineRef.UnWrap(command_line));
|
TCefBrowserProcessHandlerOwn(TempObject).OnBeforeChildProcessLaunch(TCefCommandLineRef.UnWrap(command_line));
|
||||||
end;
|
end;
|
||||||
@ -107,8 +110,8 @@ procedure cef_browser_process_handler_on_render_process_thread_created(self
|
|||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
begin
|
begin
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
||||||
TCefBrowserProcessHandlerOwn(TempObject).OnRenderProcessThreadCreated(TCefListValueRef.UnWrap(extra_info));
|
TCefBrowserProcessHandlerOwn(TempObject).OnRenderProcessThreadCreated(TCefListValueRef.UnWrap(extra_info));
|
||||||
end;
|
end;
|
||||||
@ -117,12 +120,12 @@ function cef_browser_process_handler_get_print_handler(self: PCefBrowserProcessH
|
|||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
begin
|
begin
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
||||||
Result := CefGetData(TCefBrowserProcessHandlerOwn(TempObject).GetPrintHandler)
|
Result := CefGetData(TCefBrowserProcessHandlerOwn(TempObject).GetPrintHandler)
|
||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cef_browser_process_handler_on_schedule_message_pump_work(self : PCefBrowserProcessHandler;
|
procedure cef_browser_process_handler_on_schedule_message_pump_work(self : PCefBrowserProcessHandler;
|
||||||
@ -130,8 +133,8 @@ procedure cef_browser_process_handler_on_schedule_message_pump_work(self : P
|
|||||||
var
|
var
|
||||||
TempObject : TObject;
|
TempObject : TObject;
|
||||||
begin
|
begin
|
||||||
TempObject := CefGetObject(self);
|
TempObject := CefGetObject(self);
|
||||||
|
|
||||||
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
if (TempObject <> nil) and (TempObject is TCefBrowserProcessHandlerOwn) then
|
||||||
TCefBrowserProcessHandlerOwn(TempObject).OnScheduleMessagePumpWork(delay_ms);
|
TCefBrowserProcessHandlerOwn(TempObject).OnScheduleMessagePumpWork(delay_ms);
|
||||||
end;
|
end;
|
||||||
@ -152,45 +155,50 @@ end;
|
|||||||
|
|
||||||
function TCefBrowserProcessHandlerOwn.GetPrintHandler : ICefPrintHandler;
|
function TCefBrowserProcessHandlerOwn.GetPrintHandler : ICefPrintHandler;
|
||||||
begin
|
begin
|
||||||
Result := nil; // only linux
|
Result := nil; // only linux
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
// TCefCustomBrowserProcessHandler
|
// TCefCustomBrowserProcessHandler
|
||||||
|
|
||||||
|
|
||||||
constructor TCefCustomBrowserProcessHandler.Create(const aCefApp : TCefApplication);
|
constructor TCefCustomBrowserProcessHandler.Create(const aCefApp : TCefApplication);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FCefApp := aCefApp;
|
FCefApp := aCefApp;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TCefCustomBrowserProcessHandler.Destroy;
|
||||||
|
begin
|
||||||
|
InitializeVars;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCefCustomBrowserProcessHandler.Destroy;
|
procedure TCefCustomBrowserProcessHandler.InitializeVars;
|
||||||
begin
|
begin
|
||||||
FCefApp := nil;
|
FCefApp := nil;
|
||||||
|
|
||||||
inherited Destroy;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.OnContextInitialized;
|
procedure TCefCustomBrowserProcessHandler.OnContextInitialized;
|
||||||
begin
|
begin
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnContextInitialized;
|
if (FCefApp <> nil) then FCefApp.Internal_OnContextInitialized;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine);
|
procedure TCefCustomBrowserProcessHandler.OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine);
|
||||||
begin
|
begin
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnBeforeChildProcessLaunch(commandLine);
|
if (FCefApp <> nil) then FCefApp.Internal_OnBeforeChildProcessLaunch(commandLine);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.OnRenderProcessThreadCreated(const extraInfo: ICefListValue);
|
procedure TCefCustomBrowserProcessHandler.OnRenderProcessThreadCreated(const extraInfo: ICefListValue);
|
||||||
begin
|
begin
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnRenderProcessThreadCreated(extraInfo);
|
if (FCefApp <> nil) then FCefApp.Internal_OnRenderProcessThreadCreated(extraInfo);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCefCustomBrowserProcessHandler.OnScheduleMessagePumpWork(const delayMs: Int64);
|
procedure TCefCustomBrowserProcessHandler.OnScheduleMessagePumpWork(const delayMs: Int64);
|
||||||
begin
|
begin
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnScheduleMessagePumpWork(delayMs);
|
if (FCefApp <> nil) then FCefApp.Internal_OnScheduleMessagePumpWork(delayMs);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -261,6 +261,14 @@ type
|
|||||||
function CreateBrowserHost(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aContext : ICefRequestContext): Boolean;
|
function CreateBrowserHost(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aContext : ICefRequestContext): Boolean;
|
||||||
function CreateBrowserHostSync(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aContext : ICefRequestContext): ICefBrowser;
|
function CreateBrowserHostSync(aWindowInfo : PCefWindowInfo; const aURL : ustring; const aSettings : PCefBrowserSettings; const aContext : ICefRequestContext): ICefBrowser;
|
||||||
|
|
||||||
|
procedure DestroyClientHandler;
|
||||||
|
procedure DestroyVisitor;
|
||||||
|
procedure DestroyPDFPrintcb;
|
||||||
|
procedure DestroyResolveHostcb;
|
||||||
|
procedure DestroyCookiDeletercb;
|
||||||
|
|
||||||
|
procedure ClearBrowserReference;
|
||||||
|
|
||||||
procedure InitializeEvents;
|
procedure InitializeEvents;
|
||||||
procedure InitializeSettings(var aSettings : TCefBrowserSettings);
|
procedure InitializeSettings(var aSettings : TCefBrowserSettings);
|
||||||
|
|
||||||
@ -758,13 +766,13 @@ begin
|
|||||||
FCompHandle := 0;
|
FCompHandle := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FBrowser := nil;
|
ClearBrowserReference;
|
||||||
FBrowserId := 0;
|
|
||||||
FHandler := nil;
|
DestroyClientHandler;
|
||||||
FVisitor := nil;
|
DestroyVisitor;
|
||||||
FPDFPrintcb := nil;
|
DestroyPDFPrintcb;
|
||||||
FResolveHostcb := nil;
|
DestroyResolveHostcb;
|
||||||
FCookiDeletercb := nil;
|
DestroyCookiDeletercb;
|
||||||
|
|
||||||
if (FFontOptions <> nil) then FreeAndNil(FFontOptions);
|
if (FFontOptions <> nil) then FreeAndNil(FFontOptions);
|
||||||
if (FOptions <> nil) then FreeAndNil(FOptions);
|
if (FOptions <> nil) then FreeAndNil(FOptions);
|
||||||
@ -778,6 +786,57 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChromium.ClearBrowserReference;
|
||||||
|
begin
|
||||||
|
FBrowser := nil;
|
||||||
|
FBrowserId := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromium.DestroyClientHandler;
|
||||||
|
begin
|
||||||
|
if (FHandler <> nil) then
|
||||||
|
begin
|
||||||
|
FHandler.InitializeVars;
|
||||||
|
FHandler := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromium.DestroyVisitor;
|
||||||
|
begin
|
||||||
|
if (FVisitor <> nil) then
|
||||||
|
begin
|
||||||
|
FVisitor.InitializeVars;
|
||||||
|
FVisitor := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromium.DestroyPDFPrintcb;
|
||||||
|
begin
|
||||||
|
if (FPDFPrintcb <> nil) then
|
||||||
|
begin
|
||||||
|
FPDFPrintcb.InitializeVars;
|
||||||
|
FPDFPrintcb := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromium.DestroyResolveHostcb;
|
||||||
|
begin
|
||||||
|
if (FResolveHostcb <> nil) then
|
||||||
|
begin
|
||||||
|
FResolveHostcb.InitializeVars;
|
||||||
|
FResolveHostcb := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TChromium.DestroyCookiDeletercb;
|
||||||
|
begin
|
||||||
|
if (FCookiDeletercb <> nil) then
|
||||||
|
begin
|
||||||
|
FCookiDeletercb.InitializeVars;
|
||||||
|
FCookiDeletercb := nil;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TChromium.AfterConstruction;
|
procedure TChromium.AfterConstruction;
|
||||||
begin
|
begin
|
||||||
inherited AfterConstruction;
|
inherited AfterConstruction;
|
||||||
@ -2770,9 +2829,8 @@ begin
|
|||||||
if (browser <> nil) and (FBrowserId = browser.Identifier) then
|
if (browser <> nil) and (FBrowserId = browser.Identifier) then
|
||||||
begin
|
begin
|
||||||
FInitialized := False;
|
FInitialized := False;
|
||||||
FBrowser := nil;
|
ClearBrowserReference;
|
||||||
FBrowserId := 0;
|
DestroyClientHandler;
|
||||||
FHandler := nil;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Assigned(FOnBeforeClose) then FOnBeforeClose(Self, browser);
|
if Assigned(FOnBeforeClose) then FOnBeforeClose(Self, browser);
|
||||||
|
@ -73,6 +73,8 @@ type
|
|||||||
function GetRequestHandler: ICefRequestHandler; virtual;
|
function GetRequestHandler: ICefRequestHandler; virtual;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; virtual;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; virtual;
|
||||||
|
|
||||||
|
procedure InitializeVars; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
class function UnWrap(data: Pointer): ICefClient;
|
class function UnWrap(data: Pointer): ICefClient;
|
||||||
end;
|
end;
|
||||||
@ -95,6 +97,8 @@ type
|
|||||||
function GetRequestHandler: ICefRequestHandler; virtual;
|
function GetRequestHandler: ICefRequestHandler; virtual;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; virtual;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; virtual;
|
||||||
|
|
||||||
|
procedure InitializeVars; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
@ -133,8 +137,6 @@ type
|
|||||||
function GetRequestHandler: ICefRequestHandler; override;
|
function GetRequestHandler: ICefRequestHandler; override;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; override;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean; override;
|
||||||
|
|
||||||
procedure InitializeInterfaces;
|
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const events: IChromiumEvents;
|
constructor Create(const events: IChromiumEvents;
|
||||||
aCreateLoadHandler, aCreateFocusHandler, aCreateContextMenuHandler, aCreateDialogHandler,
|
aCreateLoadHandler, aCreateFocusHandler, aCreateContextMenuHandler, aCreateDialogHandler,
|
||||||
@ -142,6 +144,7 @@ type
|
|||||||
aCreateJsDialogHandler, aCreateLifeSpanHandler, aCreateRenderHandler, aCreateRequestHandler,
|
aCreateJsDialogHandler, aCreateLifeSpanHandler, aCreateRenderHandler, aCreateRequestHandler,
|
||||||
aCreateDragHandler, aCreateFindHandler : boolean); reintroduce; virtual;
|
aCreateDragHandler, aCreateFindHandler : boolean); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -246,6 +249,11 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefClientRef.InitializeVars;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
// ******************************************************
|
// ******************************************************
|
||||||
// ****************** TCefClientOwn *********************
|
// ****************** TCefClientOwn *********************
|
||||||
@ -442,6 +450,11 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefClientOwn.InitializeVars;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
// ******************************************************
|
// ******************************************************
|
||||||
// *************** TCustomClientHandler *****************
|
// *************** TCustomClientHandler *****************
|
||||||
@ -466,7 +479,7 @@ constructor TCustomClientHandler.Create(const events : IChro
|
|||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
InitializeInterfaces;
|
InitializeVars;
|
||||||
|
|
||||||
FEvents := events;
|
FEvents := events;
|
||||||
|
|
||||||
@ -491,12 +504,12 @@ end;
|
|||||||
|
|
||||||
destructor TCustomClientHandler.Destroy;
|
destructor TCustomClientHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
InitializeInterfaces;
|
InitializeVars;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomClientHandler.InitializeInterfaces;
|
procedure TCustomClientHandler.InitializeVars;
|
||||||
begin
|
begin
|
||||||
FLoadHandler := nil;
|
FLoadHandler := nil;
|
||||||
FFocusHandler := nil;
|
FFocusHandler := nil;
|
||||||
|
@ -53,6 +53,7 @@ type
|
|||||||
TCefDeleteCookiesCallbackOwn = class(TCefBaseRefCountedOwn, ICefDeleteCookiesCallback)
|
TCefDeleteCookiesCallbackOwn = class(TCefBaseRefCountedOwn, ICefDeleteCookiesCallback)
|
||||||
protected
|
protected
|
||||||
procedure OnComplete(numDeleted: Integer); virtual; abstract;
|
procedure OnComplete(numDeleted: Integer); virtual; abstract;
|
||||||
|
procedure InitializeVars; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
@ -66,6 +67,8 @@ type
|
|||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const callback: TCefDeleteCookiesCallbackProc); reintroduce;
|
constructor Create(const callback: TCefDeleteCookiesCallbackProc); reintroduce;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCefCustomDeleteCookiesCallback = class(TCefDeleteCookiesCallbackOwn)
|
TCefCustomDeleteCookiesCallback = class(TCefDeleteCookiesCallbackOwn)
|
||||||
@ -76,6 +79,8 @@ type
|
|||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : TObject); reintroduce;
|
constructor Create(const aChromiumBrowser : TObject); reintroduce;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -108,7 +113,19 @@ end;
|
|||||||
|
|
||||||
procedure TCefFastDeleteCookiesCallback.OnComplete(numDeleted: Integer);
|
procedure TCefFastDeleteCookiesCallback.OnComplete(numDeleted: Integer);
|
||||||
begin
|
begin
|
||||||
FCallback(numDeleted)
|
if assigned(FCallback) then FCallback(numDeleted)
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TCefFastDeleteCookiesCallback.Destroy;
|
||||||
|
begin
|
||||||
|
InitializeVars;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCefFastDeleteCookiesCallback.InitializeVars;
|
||||||
|
begin
|
||||||
|
FCallback := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefCustomDeleteCookiesCallback
|
// TCefCustomDeleteCookiesCallback
|
||||||
@ -120,6 +137,18 @@ begin
|
|||||||
FChromiumBrowser := aChromiumBrowser;
|
FChromiumBrowser := aChromiumBrowser;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TCefCustomDeleteCookiesCallback.Destroy;
|
||||||
|
begin
|
||||||
|
InitializeVars;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCefCustomDeleteCookiesCallback.InitializeVars;
|
||||||
|
begin
|
||||||
|
FChromiumBrowser := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefCustomDeleteCookiesCallback.OnComplete(numDeleted: Integer);
|
procedure TCefCustomDeleteCookiesCallback.OnComplete(numDeleted: Integer);
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then
|
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then
|
||||||
|
@ -166,6 +166,7 @@ type
|
|||||||
ICefPdfPrintCallback = interface(ICefBaseRefCounted)
|
ICefPdfPrintCallback = interface(ICefBaseRefCounted)
|
||||||
['{F1CC58E9-2C30-4932-91AE-467C8D8EFB8E}']
|
['{F1CC58E9-2C30-4932-91AE-467C8D8EFB8E}']
|
||||||
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean);
|
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean);
|
||||||
|
procedure InitializeVars; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TOnDownloadImageFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF}
|
TOnDownloadImageFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF}
|
||||||
@ -383,6 +384,7 @@ type
|
|||||||
ICefStringVisitor = interface(ICefBaseRefCounted)
|
ICefStringVisitor = interface(ICefBaseRefCounted)
|
||||||
['{63ED4D6C-2FC8-4537-964B-B84C008F6158}']
|
['{63ED4D6C-2FC8-4537-964B-B84C008F6158}']
|
||||||
procedure Visit(const str: ustring);
|
procedure Visit(const str: ustring);
|
||||||
|
procedure InitializeVars; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefFrame = interface(ICefBaseRefCounted)
|
ICefFrame = interface(ICefBaseRefCounted)
|
||||||
@ -859,6 +861,8 @@ type
|
|||||||
function GetLocalizedString(stringId: Integer; var stringVal: ustring): Boolean;
|
function GetLocalizedString(stringId: Integer; var stringVal: ustring): Boolean;
|
||||||
function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean;
|
function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean;
|
||||||
function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean;
|
function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean;
|
||||||
|
|
||||||
|
procedure InitializeVars; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefBrowserProcessHandler = interface(ICefBaseRefCounted)
|
ICefBrowserProcessHandler = interface(ICefBaseRefCounted)
|
||||||
@ -868,6 +872,8 @@ type
|
|||||||
procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue);
|
procedure OnRenderProcessThreadCreated(const extraInfo: ICefListValue);
|
||||||
function GetPrintHandler : ICefPrintHandler;
|
function GetPrintHandler : ICefPrintHandler;
|
||||||
procedure OnScheduleMessagePumpWork(const delayMs: Int64);
|
procedure OnScheduleMessagePumpWork(const delayMs: Int64);
|
||||||
|
|
||||||
|
procedure InitializeVars; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRenderProcessHandler = interface(ICefBaseRefCounted)
|
ICefRenderProcessHandler = interface(ICefBaseRefCounted)
|
||||||
@ -883,6 +889,8 @@ type
|
|||||||
procedure OnUncaughtException(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const exception: ICefV8Exception; const stackTrace: ICefV8StackTrace);
|
procedure OnUncaughtException(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const exception: ICefV8Exception; const stackTrace: ICefV8StackTrace);
|
||||||
procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode);
|
procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode);
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean;
|
||||||
|
|
||||||
|
procedure InitializeVars; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefApp = interface(ICefBaseRefCounted)
|
ICefApp = interface(ICefBaseRefCounted)
|
||||||
@ -912,6 +920,7 @@ type
|
|||||||
ICefDeleteCookiesCallback = interface(ICefBaseRefCounted)
|
ICefDeleteCookiesCallback = interface(ICefBaseRefCounted)
|
||||||
['{758B79A1-B9E8-4F0D-94A0-DCE5AFADE33D}']
|
['{758B79A1-B9E8-4F0D-94A0-DCE5AFADE33D}']
|
||||||
procedure OnComplete(numDeleted: Integer);
|
procedure OnComplete(numDeleted: Integer);
|
||||||
|
procedure InitializeVars; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefCookieManager = Interface(ICefBaseRefCounted)
|
ICefCookieManager = Interface(ICefBaseRefCounted)
|
||||||
@ -1377,8 +1386,9 @@ type
|
|||||||
function GetLoadHandler: ICefLoadHandler;
|
function GetLoadHandler: ICefLoadHandler;
|
||||||
function GetRenderHandler: ICefRenderHandler;
|
function GetRenderHandler: ICefRenderHandler;
|
||||||
function GetRequestHandler: ICefRequestHandler;
|
function GetRequestHandler: ICefRequestHandler;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean;
|
||||||
sourceProcess: TCefProcessId; const message: ICefProcessMessage): Boolean;
|
|
||||||
|
procedure InitializeVars; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefUrlRequest = interface(ICefBaseRefCounted)
|
ICefUrlRequest = interface(ICefBaseRefCounted)
|
||||||
@ -1482,6 +1492,7 @@ type
|
|||||||
ICefResolveCallback = interface(ICefBaseRefCounted)
|
ICefResolveCallback = interface(ICefBaseRefCounted)
|
||||||
['{0C0EA252-7968-4163-A1BE-A1453576DD06}']
|
['{0C0EA252-7968-4163-A1BE-A1453576DD06}']
|
||||||
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings);
|
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings);
|
||||||
|
procedure InitializeVars; // custom procedure to clear all references
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ICefRequestContext = interface(ICefBaseRefCounted)
|
ICefRequestContext = interface(ICefBaseRefCounted)
|
||||||
|
@ -54,6 +54,8 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean); virtual; abstract;
|
procedure OnPdfPrintFinished(const path: ustring; ok: Boolean); virtual; abstract;
|
||||||
|
|
||||||
|
procedure InitializeVars; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
@ -66,6 +68,8 @@ type
|
|||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const proc: TOnPdfPrintFinishedProc); reintroduce;
|
constructor Create(const proc: TOnPdfPrintFinishedProc); reintroduce;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCefCustomPDFPrintCallBack = class(TCefPdfPrintCallbackOwn)
|
TCefCustomPDFPrintCallBack = class(TCefPdfPrintCallbackOwn)
|
||||||
@ -76,6 +80,8 @@ type
|
|||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : TObject); reintroduce;
|
constructor Create(const aChromiumBrowser : TObject); reintroduce;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -105,7 +111,19 @@ end;
|
|||||||
|
|
||||||
procedure TCefFastPdfPrintCallback.OnPdfPrintFinished(const path: ustring; ok: Boolean);
|
procedure TCefFastPdfPrintCallback.OnPdfPrintFinished(const path: ustring; ok: Boolean);
|
||||||
begin
|
begin
|
||||||
FProc(path, ok);
|
if assigned(FProc) then FProc(path, ok);
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TCefFastPdfPrintCallback.Destroy;
|
||||||
|
begin
|
||||||
|
InitializeVars;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCefFastPdfPrintCallback.InitializeVars;
|
||||||
|
begin
|
||||||
|
FProc := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// TCefCustomPDFPrintCallBack
|
// TCefCustomPDFPrintCallBack
|
||||||
@ -117,6 +135,18 @@ begin
|
|||||||
FChromiumBrowser := aChromiumBrowser;
|
FChromiumBrowser := aChromiumBrowser;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TCefCustomPDFPrintCallBack.Destroy;
|
||||||
|
begin
|
||||||
|
InitializeVars;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCefCustomPDFPrintCallBack.InitializeVars;
|
||||||
|
begin
|
||||||
|
FChromiumBrowser := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefCustomPDFPrintCallBack.OnPdfPrintFinished(const path: ustring; aResultOK : Boolean);
|
procedure TCefCustomPDFPrintCallBack.OnPdfPrintFinished(const path: ustring; aResultOK : Boolean);
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then
|
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then
|
||||||
|
@ -69,6 +69,9 @@ type
|
|||||||
procedure OnUncaughtException(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const exception: ICefV8Exception; const stackTrace: ICefV8StackTrace); virtual; abstract;
|
procedure OnUncaughtException(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const exception: ICefV8Exception; const stackTrace: ICefV8StackTrace); virtual; abstract;
|
||||||
procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode); virtual; abstract;
|
procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode); virtual; abstract;
|
||||||
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean; virtual;
|
function OnProcessMessageReceived(const browser: ICefBrowser; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean; virtual;
|
||||||
|
|
||||||
|
procedure InitializeVars; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
@ -91,6 +94,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -313,11 +317,16 @@ end;
|
|||||||
|
|
||||||
destructor TCefCustomRenderProcessHandler.Destroy;
|
destructor TCefCustomRenderProcessHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FCefApp := nil;
|
InitializeVars;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefCustomRenderProcessHandler.InitializeVars;
|
||||||
|
begin
|
||||||
|
FCefApp := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefCustomRenderProcessHandler.OnRenderThreadCreated(const extraInfo: ICefListValue);
|
procedure TCefCustomRenderProcessHandler.OnRenderThreadCreated(const extraInfo: ICefListValue);
|
||||||
begin
|
begin
|
||||||
if (FCefApp <> nil) then FCefApp.Internal_OnRenderThreadCreated(extraInfo);
|
if (FCefApp <> nil) then FCefApp.Internal_OnRenderThreadCreated(extraInfo);
|
||||||
|
@ -58,6 +58,8 @@ type
|
|||||||
TCefResolveCallbackOwn = class(TCefBaseRefCountedOwn, ICefResolveCallback)
|
TCefResolveCallbackOwn = class(TCefBaseRefCountedOwn, ICefResolveCallback)
|
||||||
protected
|
protected
|
||||||
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings); virtual; abstract;
|
procedure OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings); virtual; abstract;
|
||||||
|
procedure InitializeVars; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
@ -69,6 +71,8 @@ type
|
|||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : TObject); reintroduce;
|
constructor Create(const aChromiumBrowser : TObject); reintroduce;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -129,6 +133,18 @@ begin
|
|||||||
FChromiumBrowser := aChromiumBrowser;
|
FChromiumBrowser := aChromiumBrowser;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TCefCustomResolveCallback.Destroy;
|
||||||
|
begin
|
||||||
|
InitializeVars;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCefCustomResolveCallback.InitializeVars;
|
||||||
|
begin
|
||||||
|
FChromiumBrowser := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCefCustomResolveCallback.OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings);
|
procedure TCefCustomResolveCallback.OnResolveCompleted(result: TCefErrorCode; const resolvedIps: TStrings);
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then
|
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then
|
||||||
|
@ -56,6 +56,8 @@ type
|
|||||||
function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean; virtual; abstract;
|
function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean; virtual; abstract;
|
||||||
function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean; virtual; abstract;
|
function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean; virtual; abstract;
|
||||||
|
|
||||||
|
procedure InitializeVars; virtual; abstract;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
@ -71,6 +73,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
constructor Create(const aCefApp : TCefApplication); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -154,11 +157,16 @@ end;
|
|||||||
|
|
||||||
destructor TCefCustomResourceBundleHandler.Destroy;
|
destructor TCefCustomResourceBundleHandler.Destroy;
|
||||||
begin
|
begin
|
||||||
FCefApp := nil;
|
InitializeVars;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefCustomResourceBundleHandler.InitializeVars;
|
||||||
|
begin
|
||||||
|
FCefApp := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCefCustomResourceBundleHandler.GetLocalizedString(stringid : Integer;
|
function TCefCustomResourceBundleHandler.GetLocalizedString(stringid : Integer;
|
||||||
var stringVal : ustring): Boolean;
|
var stringVal : ustring): Boolean;
|
||||||
begin
|
begin
|
||||||
|
@ -53,12 +53,13 @@ type
|
|||||||
TCefStringVisitorOwn = class(TCefBaseRefCountedOwn, ICefStringVisitor)
|
TCefStringVisitorOwn = class(TCefBaseRefCountedOwn, ICefStringVisitor)
|
||||||
protected
|
protected
|
||||||
procedure Visit(const str: ustring); virtual;
|
procedure Visit(const str: ustring); virtual;
|
||||||
|
procedure InitializeVars; virtual;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TCefFastStringVisitor = class(TCefStringVisitorOwn, ICefStringVisitor)
|
TCefFastStringVisitor = class(TCefStringVisitorOwn)
|
||||||
protected
|
protected
|
||||||
FVisit: TCefStringVisitorProc;
|
FVisit: TCefStringVisitorProc;
|
||||||
|
|
||||||
@ -76,6 +77,8 @@ type
|
|||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(const aChromiumBrowser : TObject); reintroduce;
|
constructor Create(const aChromiumBrowser : TObject); reintroduce;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure InitializeVars; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -102,6 +105,11 @@ begin
|
|||||||
//
|
//
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCefStringVisitorOwn.InitializeVars;
|
||||||
|
begin
|
||||||
|
//
|
||||||
|
end;
|
||||||
|
|
||||||
// TCefFastStringVisitor
|
// TCefFastStringVisitor
|
||||||
|
|
||||||
constructor TCefFastStringVisitor.Create(const callback: TCefStringVisitorProc);
|
constructor TCefFastStringVisitor.Create(const callback: TCefStringVisitorProc);
|
||||||
@ -125,6 +133,18 @@ begin
|
|||||||
FChromiumBrowser := aChromiumBrowser;
|
FChromiumBrowser := aChromiumBrowser;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
destructor TCustomCefStringVisitor.Destroy;
|
||||||
|
begin
|
||||||
|
InitializeVars;
|
||||||
|
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCustomCefStringVisitor.InitializeVars;
|
||||||
|
begin
|
||||||
|
FChromiumBrowser := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomCefStringVisitor.Visit(const str: ustring);
|
procedure TCustomCefStringVisitor.Visit(const str: ustring);
|
||||||
begin
|
begin
|
||||||
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then
|
if (FChromiumBrowser <> nil) and (FChromiumBrowser is TChromium) then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user