CEF4Delphi/source/uCEFSharedMemoryRegion.pas
salvadordf ca8bc9dff4 Added cef4delphi.chm help file
Added the PDS file to extract the HTML Help files using PasDoc
Added more XML documentation
Fixed some XML errors.
Removed the license copy from the pas units.
Updated the LICENSE.md file
2023-08-09 19:38:57 +02:00

54 lines
1.1 KiB
ObjectPascal

unit uCEFSharedMemoryRegion;
{$IFDEF FPC}
{$MODE OBJFPC}{$H+}
{$ENDIF}
{$I cef.inc}
{$IFNDEF TARGET_64BITS}{$ALIGN ON}{$ENDIF}
{$MINENUMSIZE 4}
interface
uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes;
type
TCefSharedMemoryRegionRef = class(TCefBaseRefCountedRef, ICefSharedMemoryRegion)
protected
function IsValid: boolean;
function Size: NativeUInt;
function Memory: pointer;
public
class function UnWrap(data: Pointer): ICefSharedMemoryRegion;
end;
implementation
function TCefSharedMemoryRegionRef.IsValid: Boolean;
begin
Result := PCefSharedMemoryRegion(FData)^.is_valid(PCefSharedMemoryRegion(FData)) <> 0;
end;
function TCefSharedMemoryRegionRef.Size: NativeUInt;
begin
Result := PCefSharedMemoryRegion(FData)^.Size(PCefSharedMemoryRegion(FData));
end;
function TCefSharedMemoryRegionRef.Memory: pointer;
begin
Result := PCefSharedMemoryRegion(FData)^.Memory(PCefSharedMemoryRegion(FData));
end;
class function TCefSharedMemoryRegionRef.UnWrap(data: Pointer): ICefSharedMemoryRegion;
begin
if (data <> nil) then
Result := Create(data) as ICefSharedMemoryRegion
else
Result := nil;
end;
end.