mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Pass information to the renderer process synchronously on render thread creation and new browser creation to avoid race conditions (issue #744).
- Add the ability to pass extra information to child processes using a new CefBrowserProcessHandler::OnRenderProcessThreadCreated callback (issue #744). - Fix OnBeforeChildProcessLaunch documentation (issue #754). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@910 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/proxy_handler_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/command_line_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
|
||||
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
@@ -63,6 +64,24 @@ void CEF_CALLBACK browser_process_handler_on_before_child_process_launch(
|
||||
CefCommandLineCToCpp::Wrap(command_line));
|
||||
}
|
||||
|
||||
void CEF_CALLBACK browser_process_handler_on_render_process_thread_created(
|
||||
struct _cef_browser_process_handler_t* self,
|
||||
struct _cef_list_value_t* extra_info) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: extra_info; type: refptr_diff
|
||||
DCHECK(extra_info);
|
||||
if (!extra_info)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefBrowserProcessHandlerCppToC::Get(self)->OnRenderProcessThreadCreated(
|
||||
CefListValueCToCpp::Wrap(extra_info));
|
||||
}
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
@@ -75,6 +94,8 @@ CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC(
|
||||
browser_process_handler_on_context_initialized;
|
||||
struct_.struct_.on_before_child_process_launch =
|
||||
browser_process_handler_on_before_child_process_launch;
|
||||
struct_.struct_.on_render_process_thread_created =
|
||||
browser_process_handler_on_render_process_thread_created;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/process_message_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/request_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8context_ctocpp.h"
|
||||
@@ -24,15 +25,21 @@
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK render_process_handler_on_render_thread_created(
|
||||
struct _cef_render_process_handler_t* self) {
|
||||
struct _cef_render_process_handler_t* self,
|
||||
struct _cef_list_value_t* extra_info) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: extra_info; type: refptr_diff
|
||||
DCHECK(extra_info);
|
||||
if (!extra_info)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefRenderProcessHandlerCppToC::Get(self)->OnRenderThreadCreated();
|
||||
CefRenderProcessHandlerCppToC::Get(self)->OnRenderThreadCreated(
|
||||
CefListValueCToCpp::Wrap(extra_info));
|
||||
}
|
||||
|
||||
void CEF_CALLBACK render_process_handler_on_web_kit_initialized(
|
||||
|
@@ -11,6 +11,7 @@
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/command_line_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/list_value_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/proxy_handler_ctocpp.h"
|
||||
|
||||
@@ -57,6 +58,23 @@ void CefBrowserProcessHandlerCToCpp::OnBeforeChildProcessLaunch(
|
||||
CefCommandLineCppToC::Wrap(command_line));
|
||||
}
|
||||
|
||||
void CefBrowserProcessHandlerCToCpp::OnRenderProcessThreadCreated(
|
||||
CefRefPtr<CefListValue> extra_info) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_render_process_thread_created))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: extra_info; type: refptr_diff
|
||||
DCHECK(extra_info.get());
|
||||
if (!extra_info.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
struct_->on_render_process_thread_created(struct_,
|
||||
CefListValueCppToC::Wrap(extra_info));
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefBrowserProcessHandlerCToCpp,
|
||||
|
@@ -38,6 +38,8 @@ class CefBrowserProcessHandlerCToCpp
|
||||
virtual void OnContextInitialized() OVERRIDE;
|
||||
virtual void OnBeforeChildProcessLaunch(
|
||||
CefRefPtr<CefCommandLine> command_line) OVERRIDE;
|
||||
virtual void OnRenderProcessThreadCreated(
|
||||
CefRefPtr<CefListValue> extra_info) OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // BUILDING_CEF_SHARED
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/domnode_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/list_value_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/process_message_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
||||
#include "libcef_dll/cpptoc/v8context_cpptoc.h"
|
||||
@@ -23,14 +24,21 @@
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
void CefRenderProcessHandlerCToCpp::OnRenderThreadCreated() {
|
||||
void CefRenderProcessHandlerCToCpp::OnRenderThreadCreated(
|
||||
CefRefPtr<CefListValue> extra_info) {
|
||||
if (CEF_MEMBER_MISSING(struct_, on_render_thread_created))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: extra_info; type: refptr_diff
|
||||
DCHECK(extra_info.get());
|
||||
if (!extra_info.get())
|
||||
return;
|
||||
|
||||
// Execute
|
||||
struct_->on_render_thread_created(struct_);
|
||||
struct_->on_render_thread_created(struct_,
|
||||
CefListValueCppToC::Wrap(extra_info));
|
||||
}
|
||||
|
||||
void CefRenderProcessHandlerCToCpp::OnWebKitInitialized() {
|
||||
|
@@ -34,7 +34,8 @@ class CefRenderProcessHandlerCToCpp
|
||||
virtual ~CefRenderProcessHandlerCToCpp() {}
|
||||
|
||||
// CefRenderProcessHandler methods
|
||||
virtual void OnRenderThreadCreated() OVERRIDE;
|
||||
virtual void OnRenderThreadCreated(
|
||||
CefRefPtr<CefListValue> extra_info) OVERRIDE;
|
||||
virtual void OnWebKitInitialized() OVERRIDE;
|
||||
virtual void OnBrowserCreated(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
||||
virtual void OnBrowserDestroyed(CefRefPtr<CefBrowser> browser) OVERRIDE;
|
||||
|
Reference in New Issue
Block a user