mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add a new CefRequestHandler::OnRenderViewReady method which is called when a browser is ready to receive/handle IPC messages in the render process (issue #1564).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2055 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -232,6 +232,14 @@ typedef struct _cef_request_handler_t {
|
|||||||
void (CEF_CALLBACK *on_plugin_crashed)(struct _cef_request_handler_t* self,
|
void (CEF_CALLBACK *on_plugin_crashed)(struct _cef_request_handler_t* self,
|
||||||
struct _cef_browser_t* browser, const cef_string_t* plugin_path);
|
struct _cef_browser_t* browser, const cef_string_t* plugin_path);
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called on the browser process UI thread when the render view associated
|
||||||
|
// with |browser| is ready to receive/handle IPC messages in the render
|
||||||
|
// process.
|
||||||
|
///
|
||||||
|
void (CEF_CALLBACK *on_render_view_ready)(struct _cef_request_handler_t* self,
|
||||||
|
struct _cef_browser_t* browser);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the browser process UI thread when the render process terminates
|
// Called on the browser process UI thread when the render process terminates
|
||||||
// unexpectedly. |status| indicates how the process terminated.
|
// unexpectedly. |status| indicates how the process terminated.
|
||||||
|
@ -261,6 +261,14 @@ class CefRequestHandler : public virtual CefBase {
|
|||||||
virtual void OnPluginCrashed(CefRefPtr<CefBrowser> browser,
|
virtual void OnPluginCrashed(CefRefPtr<CefBrowser> browser,
|
||||||
const CefString& plugin_path) {}
|
const CefString& plugin_path) {}
|
||||||
|
|
||||||
|
///
|
||||||
|
// Called on the browser process UI thread when the render view associated
|
||||||
|
// with |browser| is ready to receive/handle IPC messages in the render
|
||||||
|
// process.
|
||||||
|
///
|
||||||
|
/*--cef()--*/
|
||||||
|
virtual void OnRenderViewReady(CefRefPtr<CefBrowser> browser) {}
|
||||||
|
|
||||||
///
|
///
|
||||||
// Called on the browser process UI thread when the render process
|
// Called on the browser process UI thread when the render process
|
||||||
// terminates unexpectedly. |status| indicates how the process
|
// terminates unexpectedly. |status| indicates how the process
|
||||||
|
@ -2447,6 +2447,12 @@ void CefBrowserHostImpl::RenderViewReady() {
|
|||||||
Send(queued_messages_.front());
|
Send(queued_messages_.front());
|
||||||
queued_messages_.pop();
|
queued_messages_.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (client_.get()) {
|
||||||
|
CefRefPtr<CefRequestHandler> handler = client_->GetRequestHandler();
|
||||||
|
if (handler.get())
|
||||||
|
handler->OnRenderViewReady(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) {
|
void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) {
|
||||||
|
@ -397,6 +397,23 @@ void CEF_CALLBACK request_handler_on_plugin_crashed(
|
|||||||
CefString(plugin_path));
|
CefString(plugin_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CEF_CALLBACK request_handler_on_render_view_ready(
|
||||||
|
struct _cef_request_handler_t* self, cef_browser_t* browser) {
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
DCHECK(self);
|
||||||
|
if (!self)
|
||||||
|
return;
|
||||||
|
// Verify param: browser; type: refptr_diff
|
||||||
|
DCHECK(browser);
|
||||||
|
if (!browser)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
CefRequestHandlerCppToC::Get(self)->OnRenderViewReady(
|
||||||
|
CefBrowserCToCpp::Wrap(browser));
|
||||||
|
}
|
||||||
|
|
||||||
void CEF_CALLBACK request_handler_on_render_process_terminated(
|
void CEF_CALLBACK request_handler_on_render_process_terminated(
|
||||||
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
struct _cef_request_handler_t* self, cef_browser_t* browser,
|
||||||
cef_termination_status_t status) {
|
cef_termination_status_t status) {
|
||||||
@ -434,6 +451,7 @@ CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls)
|
|||||||
struct_.struct_.on_certificate_error = request_handler_on_certificate_error;
|
struct_.struct_.on_certificate_error = request_handler_on_certificate_error;
|
||||||
struct_.struct_.on_before_plugin_load = request_handler_on_before_plugin_load;
|
struct_.struct_.on_before_plugin_load = request_handler_on_before_plugin_load;
|
||||||
struct_.struct_.on_plugin_crashed = request_handler_on_plugin_crashed;
|
struct_.struct_.on_plugin_crashed = request_handler_on_plugin_crashed;
|
||||||
|
struct_.struct_.on_render_view_ready = request_handler_on_render_view_ready;
|
||||||
struct_.struct_.on_render_process_terminated =
|
struct_.struct_.on_render_process_terminated =
|
||||||
request_handler_on_render_process_terminated;
|
request_handler_on_render_process_terminated;
|
||||||
}
|
}
|
||||||
|
@ -375,6 +375,22 @@ void CefRequestHandlerCToCpp::OnPluginCrashed(CefRefPtr<CefBrowser> browser,
|
|||||||
plugin_path.GetStruct());
|
plugin_path.GetStruct());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefRequestHandlerCToCpp::OnRenderViewReady(CefRefPtr<CefBrowser> browser) {
|
||||||
|
if (CEF_MEMBER_MISSING(struct_, on_render_view_ready))
|
||||||
|
return;
|
||||||
|
|
||||||
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
|
// Verify param: browser; type: refptr_diff
|
||||||
|
DCHECK(browser.get());
|
||||||
|
if (!browser.get())
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
struct_->on_render_view_ready(struct_,
|
||||||
|
CefBrowserCppToC::Wrap(browser));
|
||||||
|
}
|
||||||
|
|
||||||
void CefRequestHandlerCToCpp::OnRenderProcessTerminated(
|
void CefRequestHandlerCToCpp::OnRenderProcessTerminated(
|
||||||
CefRefPtr<CefBrowser> browser, TerminationStatus status) {
|
CefRefPtr<CefBrowser> browser, TerminationStatus status) {
|
||||||
if (CEF_MEMBER_MISSING(struct_, on_render_process_terminated))
|
if (CEF_MEMBER_MISSING(struct_, on_render_process_terminated))
|
||||||
|
@ -63,6 +63,7 @@ class CefRequestHandlerCToCpp
|
|||||||
const CefString& policy_url, CefRefPtr<CefWebPluginInfo> info) override;
|
const CefString& policy_url, CefRefPtr<CefWebPluginInfo> info) override;
|
||||||
void OnPluginCrashed(CefRefPtr<CefBrowser> browser,
|
void OnPluginCrashed(CefRefPtr<CefBrowser> browser,
|
||||||
const CefString& plugin_path) override;
|
const CefString& plugin_path) override;
|
||||||
|
void OnRenderViewReady(CefRefPtr<CefBrowser> browser) override;
|
||||||
void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
|
void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser,
|
||||||
TerminationStatus status) override;
|
TerminationStatus status) override;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user