You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-22 22:17:48 +02:00
Workaround for issue #416
Possible fix for issue #416 : JSRTTIExtension and CustomTitleBar demos crash in CEF 101
This commit is contained in:
@ -87,6 +87,7 @@ type
|
|||||||
class function StrToPtr(const str: ustring): Pointer;
|
class function StrToPtr(const str: ustring): Pointer;
|
||||||
class function PtrToStr(p: Pointer): ustring;
|
class function PtrToStr(p: Pointer): ustring;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
function HandleProperties(const name: ustring; const arguments: TCefv8ValueArray; var retval: ICefv8Value): boolean;
|
||||||
function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; override;
|
function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; override;
|
||||||
|
|
||||||
public
|
public
|
||||||
@ -805,6 +806,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
function TCefRTTIExtension.HandleProperties(const name : ustring;
|
||||||
|
const arguments : TCefv8ValueArray;
|
||||||
|
var retval : ICefv8Value): boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
if name = '$g' then
|
||||||
|
SetValue(FValue, retval)
|
||||||
|
else if name = '$s' then
|
||||||
|
GetValue(FValue.TypeInfo, arguments[0], FValue)
|
||||||
|
else
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCefRTTIExtension.Execute(const name : ustring;
|
function TCefRTTIExtension.Execute(const name : ustring;
|
||||||
const object_ : ICefv8Value;
|
const object_ : ICefv8Value;
|
||||||
const arguments : TCefv8ValueArray;
|
const arguments : TCefv8ValueArray;
|
||||||
@ -825,9 +839,12 @@ var
|
|||||||
ret: TValue;
|
ret: TValue;
|
||||||
begin
|
begin
|
||||||
Result := True;
|
Result := True;
|
||||||
|
if HandleProperties(name, arguments, retval) then
|
||||||
|
exit;
|
||||||
|
|
||||||
p := PChar(name);
|
p := PChar(name);
|
||||||
m := nil;
|
m := nil;
|
||||||
if object_ <> nil then
|
if assigned(object_) and object_.IsValid then
|
||||||
begin
|
begin
|
||||||
ud := object_.GetUserData;
|
ud := object_.GetUserData;
|
||||||
if ud <> nil then
|
if ud <> nil then
|
||||||
@ -970,16 +987,6 @@ begin
|
|||||||
Exit(False);
|
Exit(False);
|
||||||
end else
|
end else
|
||||||
Exit(False);
|
Exit(False);
|
||||||
end else
|
|
||||||
if p^ = '$' then
|
|
||||||
begin
|
|
||||||
inc(p);
|
|
||||||
case p^ of
|
|
||||||
'g': SetValue(FValue, retval);
|
|
||||||
's': GetValue(FValue.TypeInfo, arguments[0], FValue);
|
|
||||||
else
|
|
||||||
Exit(False);
|
|
||||||
end;
|
|
||||||
end else
|
end else
|
||||||
Exit(False);
|
Exit(False);
|
||||||
end else
|
end else
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"UpdateLazPackages" : [
|
"UpdateLazPackages" : [
|
||||||
{
|
{
|
||||||
"ForceNotify" : true,
|
"ForceNotify" : true,
|
||||||
"InternalVersion" : 394,
|
"InternalVersion" : 395,
|
||||||
"Name" : "cef4delphi_lazarus.lpk",
|
"Name" : "cef4delphi_lazarus.lpk",
|
||||||
"Version" : "101.0.18.0"
|
"Version" : "101.0.18.0"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user