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 CefResourceManager

base::RefCountedThreadSafe
   |
   +--CefResourceManager

   in cef_resource_manager.h

class CefResourceManager
extends base::RefCountedThreadSafe

Class for managing multiple resource providers. For each resource request providers will be called in order and have the option to (a) handle the request by returning a CefResourceHandler, (b) pass the request to the next provider in order, or (c) stop handling the request. See comments on the Request object for additional usage information. The methods of this class may be called on any browser process thread unless otherwise indicated.


Inner Classes, Typedefs, and Enums
typedef CefResourceManager::MimeTypeResolver
          Used to resolve mime types for URLs, usually based on the file extension.
typedef CefResourceManager::PendingHandlersMap
          
class CefResourceManager::Provider
          Interface implemented by resource providers.
typedef CefResourceManager::ProviderEntryList
          
class CefResourceManager::Request
          Object representing a request.
typedef CefResourceManager::RequestList
          
struct CefResourceManager::RequestParams
          
struct CefResourceManager::RequestState
          
typedef CefResourceManager::UrlFilter
          Provides an opportunity to modify |url| before it is passed to a provider.
 
Constructor Summary
  CefResourceManager()
          
private  ~CefResourceManager()
          
 
Method Summary
 void AddArchiveProvider( const std::string& url_path, const std::string& archive_path, const std::string& password, int order, const std::string& identifier )
          Add a provider that maps requests that start with |url_path| to files stored in the archive file at |archive_path|.
 void AddContentProvider( const std::string& url, const std::string& content, const std::string& mime_type, int order, const std::string& identifier )
          Add a provider that maps requests for |url| to |content|.
 void AddDirectoryProvider( const std::string& url_path, const std::string& directory_path, int order, const std::string& identifier )
          Add a provider that maps requests that start with |url_path| to files under |directory_path|.
 void AddProvider( CefResourceManager::Provider* provider, int order, const std::string& identifier )
          Add a provider.
 CefRefPtr< CefResourceHandler > GetResourceHandler( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request )
          Called from CefRequestHandler::GetResourceHandler on the browser process IO thread.
 cef_return_value_t OnBeforeResourceLoad( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request, CefRefPtr< CefRequestCallback > callback )
          Called from CefRequestHandler::OnBeforeResourceLoad on the browser process IO thread.
 void RemoveAllProviders()
          Remove all providers.
 void RemoveProviders( const std::string& identifier )
          Remove all providers with the specified |identifier| value.
 void SetMimeTypeResolver( const CefResourceManager::MimeTypeResolver& resolver )
          Set the mime type resolver.
 void SetUrlFilter( const CefResourceManager::UrlFilter& filter )
          Set the url filter.
 

Constructor Detail

CefResourceManager

public CefResourceManager();

~CefResourceManager

private ~CefResourceManager();


Method Detail

AddArchiveProvider

public void AddArchiveProvider( const std::string& url_path, const std::string& archive_path, const std::string& password, int order, const std::string& identifier );
Add a provider that maps requests that start with |url_path| to files stored in the archive file at |archive_path|. |url_path| should include an origin and optional path component only. The archive file will be loaded when a matching URL is requested for the first time. See comments on AddProvider for usage of the |order| and |identifier| parameters.

AddContentProvider

public void AddContentProvider( const std::string& url, const std::string& content, const std::string& mime_type, int order, const std::string& identifier );
Add a provider that maps requests for |url| to |content|. |url| should be fully qualified but not include a query or fragment component. If |mime_type| is empty the MimeTypeResolver will be used. See comments on AddProvider for usage of the |order| and |identifier| parameters.

AddDirectoryProvider

public void AddDirectoryProvider( const std::string& url_path, const std::string& directory_path, int order, const std::string& identifier );
Add a provider that maps requests that start with |url_path| to files under |directory_path|. |url_path| should include an origin and optional path component only. Files will be loaded when a matching URL is requested. See comments on AddProvider for usage of the |order| and |identifier| parameters.

AddProvider

public void AddProvider( CefResourceManager::Provider* provider, int order, const std::string& identifier );
Add a provider. This object takes ownership of |provider|. Providers will be called in ascending order based on the |order| value. Multiple providers sharing the same |order| value will be called in the order that they were added. The |identifier| value, which does not need to be unique, can be used to remove the provider at a later time.

GetResourceHandler

public CefRefPtr< CefResourceHandler > GetResourceHandler( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request );
Called from CefRequestHandler::GetResourceHandler on the browser process IO thread.

OnBeforeResourceLoad

public cef_return_value_t OnBeforeResourceLoad( CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefRefPtr< CefRequest > request, CefRefPtr< CefRequestCallback > callback );
Called from CefRequestHandler::OnBeforeResourceLoad on the browser process IO thread.

RemoveAllProviders

public void RemoveAllProviders();
Remove all providers. If any removed providers have pending requests the Provider::OnRequestCancel method will be called. The removed providers may be deleted immediately or at a later time.

RemoveProviders

public void RemoveProviders( const std::string& identifier );
Remove all providers with the specified |identifier| value. If any removed providers have pending requests the Provider::OnRequestCancel method will be called. The removed providers may be deleted immediately or at a later time.

SetMimeTypeResolver

public void SetMimeTypeResolver( const CefResourceManager::MimeTypeResolver& resolver );
Set the mime type resolver. If not set the default resolver will be used. Changes to this value will not affect currently pending requests.

SetUrlFilter

public void SetUrlFilter( const CefResourceManager::UrlFilter& filter );
Set the url filter. If not set the default no-op filter will be used. Changes to this value will not affect currently pending requests.

 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