Chromium Embedded Framework (CEF)
114.2.1+gd70a0a8+chromium-114.0.5735.45
|
Implements the browser side of query routing. More...
#include "include/wrapper/cef_message_router.h"
Classes | |
class | Callback |
Callback associated with a single pending asynchronous query. More... | |
class | Handler |
Implement this interface to handle queries. More... | |
Public Member Functions | |
virtual bool | AddHandler (Handler *handler, bool first)=0 |
Add a new query handler. More... | |
virtual bool | RemoveHandler (Handler *handler)=0 |
Remove an existing query handler. More... | |
virtual void | CancelPending (CefRefPtr< CefBrowser > browser, Handler *handler)=0 |
Cancel all pending queries associated with either |browser| or |handler|. More... | |
virtual int | GetPendingCount (CefRefPtr< CefBrowser > browser, Handler *handler)=0 |
Returns the number of queries currently pending for the specified |browser| and/or |handler|. More... | |
virtual void | OnBeforeClose (CefRefPtr< CefBrowser > browser)=0 |
The below methods should be called from other CEF handlers. More... | |
virtual void | OnRenderProcessTerminated (CefRefPtr< CefBrowser > browser)=0 |
Call from CefRequestHandler::OnRenderProcessTerminated. More... | |
virtual void | OnBeforeBrowse (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame)=0 |
Call from CefRequestHandler::OnBeforeBrowse only if the navigation is allowed to proceed. More... | |
virtual bool | OnProcessMessageReceived (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, CefProcessId source_process, CefRefPtr< CefProcessMessage > message)=0 |
Call from CefClient::OnProcessMessageReceived. More... | |
Public Member Functions inherited from base::RefCountedThreadSafe< CefMessageRouterBrowserSide > | |
RefCountedThreadSafe () | |
RefCountedThreadSafe (const RefCountedThreadSafe &)=delete | |
RefCountedThreadSafe & | operator= (const RefCountedThreadSafe &)=delete |
void | AddRef () const |
void | Release () const |
Static Public Member Functions | |
static CefRefPtr< CefMessageRouterBrowserSide > | Create (const CefMessageRouterConfig &config) |
Create a new router with the specified configuration. More... | |
Protected Member Functions | |
virtual | ~CefMessageRouterBrowserSide () |
Protected Member Functions inherited from base::RefCountedThreadSafe< CefMessageRouterBrowserSide > | |
~RefCountedThreadSafe ()=default | |
Friends | |
class | base::RefCountedThreadSafe< CefMessageRouterBrowserSide > |
Additional Inherited Members | |
Static Public Attributes inherited from base::RefCountedThreadSafe< CefMessageRouterBrowserSide > | |
static constexpr cef_subtle::StartRefCountFromZeroTag | kRefCountPreference |
Implements the browser side of query routing.
The methods of this class may be called on any browser process thread unless otherwise indicated.
|
inlineprotectedvirtual |
|
pure virtual |
Add a new query handler.
If |first| is true it will be added as the first handler, otherwise it will be added as the last handler. Returns true if the handler is added successfully or false if the handler has already been added. Must be called on the browser process UI thread. The Handler object must either outlive the router or be removed before deletion.
|
pure virtual |
Cancel all pending queries associated with either |browser| or |handler|.
If both |browser| and |handler| are NULL all pending queries will be canceled. Handler::OnQueryCanceled will be called and the associated JavaScript onFailure callback will be executed in all cases with an error code of -1.
|
static |
Create a new router with the specified configuration.
|
pure virtual |
Returns the number of queries currently pending for the specified |browser| and/or |handler|.
Either or both values may be empty. Must be called on the browser process UI thread.
|
pure virtual |
Call from CefRequestHandler::OnBeforeBrowse only if the navigation is allowed to proceed.
If |frame| is the main frame then any pending queries associated with |browser| will be canceled and Handler::OnQueryCanceled will be called. No JavaScript callbacks will be executed since this indicates destruction of the context.
|
pure virtual |
The below methods should be called from other CEF handlers.
They must be called exactly as documented for the router to function correctly. Call from CefLifeSpanHandler::OnBeforeClose. Any pending queries associated with |browser| will be canceled and Handler::OnQueryCanceled will be called. No JavaScript callbacks will be executed since this indicates destruction of the browser.
|
pure virtual |
Call from CefClient::OnProcessMessageReceived.
Returns true if the message is handled by this router or false otherwise.
|
pure virtual |
Call from CefRequestHandler::OnRenderProcessTerminated.
Any pending queries associated with |browser| will be canceled and Handler::OnQueryCanceled will be called. No JavaScript callbacks will be executed since this indicates destruction of the context.
|
pure virtual |
Remove an existing query handler.
Any pending queries associated with the handler will be canceled. Handler::OnQueryCanceled will be called and the associated JavaScript onFailure callback will be executed with an error code of -1. Returns true if the handler is removed successfully or false if the handler is not found. Must be called on the browser process UI thread.
|
friend |