Chromium Embedded Framework (CEF)  126.2.0+g5c56e98+chromium-126.0.6478.62
CefMessageRouterBrowserSide::Handler Class Reference

Implement this interface to handle queries. More...

#include "include/wrapper/cef_message_router.h"

Public Types

using Callback = CefMessageRouterBrowserSide::Callback
 

Public Member Functions

virtual bool OnQuery (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, int64_t query_id, const CefString &request, bool persistent, CefRefPtr< Callback > callback)
 Executed when a new query is received. More...
 
virtual bool OnQuery (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, int64_t query_id, CefRefPtr< const CefBinaryBuffer > request, bool persistent, CefRefPtr< Callback > callback)
 Executed when a new query is received. More...
 
virtual void OnQueryCanceled (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, int64_t query_id)
 Executed when a query has been canceled either explicitly using the JavaScript cancel function or implicitly due to browser destruction, navigation or renderer process termination. More...
 
virtual ~Handler ()=default
 

Detailed Description

Implement this interface to handle queries.

All methods will be executed on the browser process UI thread.

Member Typedef Documentation

◆ Callback

Constructor & Destructor Documentation

◆ ~Handler()

virtual CefMessageRouterBrowserSide::Handler::~Handler ( )
virtualdefault

Member Function Documentation

◆ OnQuery() [1/2]

virtual bool CefMessageRouterBrowserSide::Handler::OnQuery ( CefRefPtr< CefBrowser browser,
CefRefPtr< CefFrame frame,
int64_t  query_id,
CefRefPtr< const CefBinaryBuffer request,
bool  persistent,
CefRefPtr< Callback callback 
)
inlinevirtual

Executed when a new query is received.

|query_id| uniquely identifies the query for the life span of the router. Return true to handle the query or false to propagate the query to other registered handlers, if any. If no handlers return true from this method then the query will be automatically canceled with an error code of -1 delivered to the JavaScript onFailure callback. If this method returns true then a Callback method must be executed either in this method or asynchronously to complete the query.

◆ OnQuery() [2/2]

virtual bool CefMessageRouterBrowserSide::Handler::OnQuery ( CefRefPtr< CefBrowser browser,
CefRefPtr< CefFrame frame,
int64_t  query_id,
const CefString request,
bool  persistent,
CefRefPtr< Callback callback 
)
inlinevirtual

Executed when a new query is received.

|query_id| uniquely identifies the query for the life span of the router. Return true to handle the query or false to propagate the query to other registered handlers, if any. If no handlers return true from this method then the query will be automatically canceled with an error code of -1 delivered to the JavaScript onFailure callback. If this method returns true then a Callback method must be executed either in this method or asynchronously to complete the query.

◆ OnQueryCanceled()

virtual void CefMessageRouterBrowserSide::Handler::OnQueryCanceled ( CefRefPtr< CefBrowser browser,
CefRefPtr< CefFrame frame,
int64_t  query_id 
)
inlinevirtual

Executed when a query has been canceled either explicitly using the JavaScript cancel function or implicitly due to browser destruction, navigation or renderer process termination.

It will only be called for the single handler that returned true from OnQuery for the same |query_id|. No references to the associated Callback object should be kept after this method is called, nor should any Callback methods be executed.


The documentation for this class was generated from the following file: