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

Added more XML documentation

This commit is contained in:
salvadordf
2023-08-07 20:21:42 +02:00
parent d94c08a349
commit 0fe7711425
11 changed files with 7181 additions and 353 deletions

View File

@@ -83,6 +83,18 @@ type
destructor Destroy; override;
end;
TCefUrlrequestClientRef = class(TCefBaseRefCountedRef, ICefUrlrequestClient)
protected
procedure OnRequestComplete(const request: ICefUrlRequest);
procedure OnUploadProgress(const request: ICefUrlRequest; current, total: Int64);
procedure OnDownloadProgress(const request: ICefUrlRequest; current, total: Int64);
procedure OnDownloadData(const request: ICefUrlRequest; data: Pointer; dataLength: NativeUInt);
function OnGetAuthCredentials(isProxy: Boolean; const host: ustring; port: Integer; const realm, scheme: ustring; const callback: ICefAuthCallback): Boolean;
procedure RemoveReferences;
public
class function UnWrap(data: Pointer): ICefUrlrequestClient;
end;
implementation
uses
@@ -297,4 +309,51 @@ begin
FEvents := nil;
end;
// TCefUrlrequestClientRef
procedure TCefUrlrequestClientRef.OnRequestComplete(const request: ICefUrlRequest);
begin
PCefUrlRequestClient(FData)^.on_request_complete(PCefUrlRequestClient(FData), CefGetData(request));
end;
procedure TCefUrlrequestClientRef.OnUploadProgress(const request: ICefUrlRequest; current, total: Int64);
begin
PCefUrlRequestClient(FData)^.on_upload_progress(PCefUrlRequestClient(FData), CefGetData(request), current, total);
end;
procedure TCefUrlrequestClientRef.OnDownloadProgress(const request: ICefUrlRequest; current, total: Int64);
begin
PCefUrlRequestClient(FData)^.on_download_progress(PCefUrlRequestClient(FData), CefGetData(request), current, total);
end;
procedure TCefUrlrequestClientRef.OnDownloadData(const request: ICefUrlRequest; data: Pointer; dataLength: NativeUInt);
begin
PCefUrlRequestClient(FData)^.on_download_data(PCefUrlRequestClient(FData), CefGetData(request), data, dataLength);
end;
function TCefUrlrequestClientRef.OnGetAuthCredentials(isProxy: Boolean; const host: ustring; port: Integer; const realm, scheme: ustring; const callback: ICefAuthCallback): Boolean;
var
TempHost, TempRealm, TempScheme : TCefString;
begin
TempHost := CefString(host);
TempRealm := CefString(realm);
TempScheme := CefString(scheme);
Result := PCefUrlRequestClient(FData)^.get_auth_credentials(PCefUrlRequestClient(FData), ord(isProxy), @TempHost, port, @TempRealm, @TempScheme, CefGetData(callback)) <> 0;
end;
procedure TCefUrlrequestClientRef.RemoveReferences;
begin
//
end;
class function TCefUrlrequestClientRef.UnWrap(data: Pointer): ICEFUrlRequestClient;
begin
if (data <> nil) then
Result := Create(data) as ICEFUrlRequestClient
else
Result := nil;
end;
end.