Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 80.1.4+g8927396+chromium-80.0.3987.149
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

(default)
Class CefResourceHandler

CefBaseRefCounted
   |
   +--CefResourceHandler

   in cef_resource_handler.h
Direct Known Subclasses:
CefStreamResourceHandler

class CefResourceHandler
extends CefBaseRefCounted

Class used to implement a custom request handler interface. The methods of this class will be called on the IO thread unless otherwise indicated.


Method Summary
 virtual void Cancel()= 0
          Request processing has been canceled.
 virtual void GetResponseHeaders( CefRefPtr< CefResponse > response, int64& response_length, CefString& redirectUrl )= 0
          Retrieve response header information.
 virtual bool Open( CefRefPtr< CefRequest > request, bool& handle_request, CefRefPtr< CefCallback > callback )
          Open the response stream.
 virtual bool ProcessRequest( CefRefPtr< CefRequest > request, CefRefPtr< CefCallback > callback )
          Begin processing the request.
 virtual bool Read( void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr< CefResourceReadCallback > callback )
          Read response data.
 virtual bool ReadResponse( void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr< CefCallback > callback )
          Read response data.
 virtual bool Skip( int64 bytes_to_skip, int64& bytes_skipped, CefRefPtr< CefResourceSkipCallback > callback )
          Skip response data when requested by a Range header.
   
Methods inherited from class CefBaseRefCounted
AddRef, Release, HasOneRef, HasAtLeastOneRef
 

Method Detail

Cancel

public virtual void Cancel()= 0;
Request processing has been canceled.

GetResponseHeaders

public virtual void GetResponseHeaders( CefRefPtr< CefResponse > response, int64& response_length, CefString& redirectUrl )= 0;
Retrieve response header information. If the response length is not known set |response_length| to -1 and ReadResponse() will be called until it returns false. If the response length is known set |response_length| to a positive value and ReadResponse() will be called until it returns false or the specified number of bytes have been read. Use the |response| object to set the mime type, http status code and other optional header values. To redirect the request to a new URL set |redirectUrl| to the new URL. |redirectUrl| can be either a relative or fully qualified URL. It is also possible to set |response| to a redirect http status code and pass the new URL via a Location header. Likewise with |redirectUrl| it is valid to set a relative or fully qualified URL as the Location header value. If an error occured while setting up the request you can call SetError() on |response| to indicate the error condition.

Open

public virtual bool Open( CefRefPtr< CefRequest > request, bool& handle_request, CefRefPtr< CefCallback > callback );
Open the response stream. To handle the request immediately set |handle_request| to true and return true. To decide at a later time set |handle_request| to false, return true, and execute |callback| to continue or cancel the request. To cancel the request immediately set |handle_request| to true and return false. This method will be called in sequence but not from a dedicated thread. For backwards compatibility set |handle_request| to false and return false and the ProcessRequest method will be called.

ProcessRequest

public virtual bool ProcessRequest( CefRefPtr< CefRequest > request, CefRefPtr< CefCallback > callback );
Begin processing the request. To handle the request return true and call CefCallback::Continue() once the response header information is available (CefCallback::Continue() can also be called from inside this method if header information is available immediately). To cancel the request return false. WARNING: This method is deprecated. Use Open instead.

Read

public virtual bool Read( void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr< CefResourceReadCallback > callback );
Read response data. If data is available immediately copy up to |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of bytes copied, and return true. To read the data at a later time keep a pointer to |data_out|, set |bytes_read| to 0, return true and execute |callback| when the data is available (|data_out| will remain valid until the callback is executed). To indicate response completion set |bytes_read| to 0 and return false. To indicate failure set |bytes_read| to < 0 (e.g. -2 for ERR_FAILED) and return false. This method will be called in sequence but not from a dedicated thread. For backwards compatibility set |bytes_read| to -1 and return false and the ReadResponse method will be called.

ReadResponse

public virtual bool ReadResponse( void* data_out, int bytes_to_read, int& bytes_read, CefRefPtr< CefCallback > callback );
Read response data. If data is available immediately copy up to |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of bytes copied, and return true. To read the data at a later time set |bytes_read| to 0, return true and call CefCallback::Continue() when the data is available. To indicate response completion return false. WARNING: This method is deprecated. Use Skip and Read instead.

Skip

public virtual bool Skip( int64 bytes_to_skip, int64& bytes_skipped, CefRefPtr< CefResourceSkipCallback > callback );
Skip response data when requested by a Range header. Skip over and discard |bytes_to_skip| bytes of response data. If data is available immediately set |bytes_skipped| to the number of bytes skipped and return true. To read the data at a later time set |bytes_skipped| to 0, return true and execute |callback| when the data is available. To indicate failure set |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false. This method will be called in sequence but not from a dedicated thread.

 Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 80.1.4+g8927396+chromium-80.0.3987.149
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt