Remove render thread created callbacks (see issue #2498)

With site-per-process enabled a spare renderer process will be created
for use with a future browser or navigation. Consequently the
|extra_info| parameter populated in OnRenderProcessThreadCreated will no
longer be delivered to OnRenderThreadCreated in the expected renderer
process. To avoid confusion these callbacks have been removed completely.

After this change CefRenderProcessHandler::OnWebKitInitialized should
be used for startup tasks in the render process, and OnBrowserCreated
should be used in the render process to recieve |extra_info| passed from
CefBrowserHost::CreateBrowser or CefLifeSpanHandler::OnBeforePopup.
This commit is contained in:
Marshall Greenblatt
2020-07-10 13:04:41 -07:00
parent 6573df6cc3
commit 280c9127c1
22 changed files with 14 additions and 254 deletions

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for // by hand. See the translator.README.txt file in the tools directory for
// more information. // more information.
// //
// $hash=b15ba2c750f5227b6b40fea59965817ba4431ee0$ // $hash=306236316b35037523ca566068d133755bce48fd$
// //
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
@ -78,17 +78,6 @@ typedef struct _cef_browser_process_handler_t {
struct _cef_browser_process_handler_t* self, struct _cef_browser_process_handler_t* self,
struct _cef_command_line_t* command_line); struct _cef_command_line_t* command_line);
///
// Called on the browser process IO thread after the main thread has been
// created for a new render process. Provides an opportunity to specify extra
// information that will be passed to
// cef_render_process_handler_t::on_render_thread_created() in the render
// process. Do not keep a reference to |extra_info| outside of this function.
///
void(CEF_CALLBACK* on_render_process_thread_created)(
struct _cef_browser_process_handler_t* self,
struct _cef_list_value_t* extra_info);
/// ///
// Return the handler for printing on Linux. If a print handler is not // Return the handler for printing on Linux. If a print handler is not
// provided then printing will not be supported on the Linux platform. // provided then printing will not be supported on the Linux platform.

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for // by hand. See the translator.README.txt file in the tools directory for
// more information. // more information.
// //
// $hash=3630a82a4ea731b43ed4ba468a57c5dfe15f8679$ // $hash=8419eb3eba9dd372b019bd367d4f195433b21c9b$
// //
#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ #ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_
@ -64,16 +64,6 @@ typedef struct _cef_render_process_handler_t {
/// ///
cef_base_ref_counted_t base; cef_base_ref_counted_t base;
///
// Called after the render process main thread has been created. |extra_info|
// is a read-only value originating from
// cef_browser_process_handler_t::on_render_process_thread_created(). Do not
// keep a reference to |extra_info| outside of this function.
///
void(CEF_CALLBACK* on_render_thread_created)(
struct _cef_render_process_handler_t* self,
struct _cef_list_value_t* extra_info);
/// ///
// Called after WebKit has been initialized. // Called after WebKit has been initialized.
/// ///

View File

@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal // way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash // hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected. // values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "cb61274ecf3ff56fdd90572f6e71a278c35ca634" #define CEF_API_HASH_UNIVERSAL "fb680f6c23c5fb612f22894422b058c8f8833703"
#if defined(OS_WIN) #if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "b44de0d5c0a0a915d78c334d962befad828cb7ab" #define CEF_API_HASH_PLATFORM "b174bf9f140ac8cdfcc8db9185723d8236768496"
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
#define CEF_API_HASH_PLATFORM "5110de7013537cf845a02484d39e47669b328e8a" #define CEF_API_HASH_PLATFORM "a93343f0e769bade840574e1547bd16546afcc9d"
#elif defined(OS_LINUX) #elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "be51e7502fede165defcae5cfd9c8ce9e80622be" #define CEF_API_HASH_PLATFORM "92fb849966e00682c42bcf22fa36a689a16c9d9f"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -68,17 +68,6 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
virtual void OnBeforeChildProcessLaunch( virtual void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) {} CefRefPtr<CefCommandLine> command_line) {}
///
// Called on the browser process IO thread after the main thread has been
// created for a new render process. Provides an opportunity to specify extra
// information that will be passed to
// CefRenderProcessHandler::OnRenderThreadCreated() in the render process. Do
// not keep a reference to |extra_info| outside of this method.
///
/*--cef()--*/
virtual void OnRenderProcessThreadCreated(
CefRefPtr<CefListValue> extra_info) {}
/// ///
// Return the handler for printing on Linux. If a print handler is not // Return the handler for printing on Linux. If a print handler is not
// provided then printing will not be supported on the Linux platform. // provided then printing will not be supported on the Linux platform.

View File

@ -57,15 +57,6 @@ class CefRenderProcessHandler : public virtual CefBaseRefCounted {
public: public:
typedef cef_navigation_type_t NavigationType; typedef cef_navigation_type_t NavigationType;
///
// Called after the render process main thread has been created. |extra_info|
// is a read-only value originating from
// CefBrowserProcessHandler::OnRenderProcessThreadCreated(). Do not keep a
// reference to |extra_info| outside of this method.
///
/*--cef()--*/
virtual void OnRenderThreadCreated(CefRefPtr<CefListValue> extra_info) {}
/// ///
// Called after WebKit has been initialized. // Called after WebKit has been initialized.
/// ///

View File

@ -1479,7 +1479,7 @@ typedef enum {
/// ///
// The main thread in the renderer. Used for all WebKit and V8 interaction. // The main thread in the renderer. Used for all WebKit and V8 interaction.
// Tasks may be posted to this thread after // Tasks may be posted to this thread after
// CefRenderProcessHandler::OnRenderThreadCreated but are not guaranteed to // CefRenderProcessHandler::OnWebKitInitialized but are not guaranteed to
// run before sub-process termination (sub-processes may be killed at any time // run before sub-process termination (sub-processes may be killed at any time
// without warning). // without warning).
/// ///

View File

@ -42,18 +42,6 @@ bool CefBrowserMessageFilter::OnMessageReceived(const IPC::Message& message) {
void CefBrowserMessageFilter::OnGetNewRenderThreadInfo( void CefBrowserMessageFilter::OnGetNewRenderThreadInfo(
CefProcessHostMsg_GetNewRenderThreadInfo_Params* params) { CefProcessHostMsg_GetNewRenderThreadInfo_Params* params) {
GetCrossOriginWhitelistEntries(&params->cross_origin_whitelist_entries); GetCrossOriginWhitelistEntries(&params->cross_origin_whitelist_entries);
CefRefPtr<CefApp> app = CefAppManager::Get()->GetApplication();
if (app.get()) {
CefRefPtr<CefBrowserProcessHandler> handler =
app->GetBrowserProcessHandler();
if (handler.get()) {
CefRefPtr<CefListValueImpl> listValuePtr(
new CefListValueImpl(&params->extra_info, false, false));
handler->OnRenderProcessThreadCreated(listValuePtr.get());
listValuePtr->Detach(nullptr);
}
}
} }
void CefBrowserMessageFilter::OnGetNewBrowserInfo(int render_frame_routing_id, void CefBrowserMessageFilter::OnGetNewBrowserInfo(int render_frame_routing_id,

View File

@ -161,8 +161,6 @@ IPC_MESSAGE_CONTROL0(CefProcessMsg_ClearCrossOriginWhitelist)
IPC_STRUCT_BEGIN(CefProcessHostMsg_GetNewRenderThreadInfo_Params) IPC_STRUCT_BEGIN(CefProcessHostMsg_GetNewRenderThreadInfo_Params)
IPC_STRUCT_MEMBER(std::vector<Cef_CrossOriginWhiteListEntry_Params>, IPC_STRUCT_MEMBER(std::vector<Cef_CrossOriginWhiteListEntry_Params>,
cross_origin_whitelist_entries) cross_origin_whitelist_entries)
IPC_STRUCT_MEMBER(base::ListValue, extra_info)
IPC_STRUCT_END() IPC_STRUCT_END()
// Retrieve information about a newly created render thread. // Retrieve information about a newly created render thread.

View File

@ -452,19 +452,6 @@ void AlloyContentRendererClient::RenderThreadConnected() {
// Cross-origin entries need to be added after WebKit is initialized. // Cross-origin entries need to be added after WebKit is initialized.
cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries; cross_origin_whitelist_entries_ = params.cross_origin_whitelist_entries;
// Notify the render process handler.
CefRefPtr<CefApp> application = CefAppManager::Get()->GetApplication();
if (application.get()) {
CefRefPtr<CefRenderProcessHandler> handler =
application->GetRenderProcessHandler();
if (handler.get()) {
CefRefPtr<CefListValueImpl> listValuePtr(
new CefListValueImpl(&params.extra_info, false, true));
handler->OnRenderThreadCreated(listValuePtr.get());
listValuePtr->Detach(nullptr);
}
}
// Register extensions last because it will trigger WebKit initialization. // Register extensions last because it will trigger WebKit initialization.
thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get()); thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get());

View File

@ -9,13 +9,12 @@
// implementations. See the translator.README.txt file in the tools directory // implementations. See the translator.README.txt file in the tools directory
// for more information. // for more information.
// //
// $hash=6c70366a25d8ad81d0adf85e2a867906f90ee695$ // $hash=7f01f5096df081ae224560eefba57b45fb9c758b$
// //
#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h" #include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h"
#include "libcef_dll/cpptoc/print_handler_cpptoc.h" #include "libcef_dll/cpptoc/print_handler_cpptoc.h"
#include "libcef_dll/ctocpp/command_line_ctocpp.h" #include "libcef_dll/ctocpp/command_line_ctocpp.h"
#include "libcef_dll/ctocpp/list_value_ctocpp.h"
namespace { namespace {
@ -51,24 +50,6 @@ void CEF_CALLBACK browser_process_handler_on_before_child_process_launch(
CefCommandLineCToCpp::Wrap(command_line)); 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));
}
struct _cef_print_handler_t* CEF_CALLBACK struct _cef_print_handler_t* CEF_CALLBACK
browser_process_handler_get_print_handler( browser_process_handler_get_print_handler(
struct _cef_browser_process_handler_t* self) { struct _cef_browser_process_handler_t* self) {
@ -109,8 +90,6 @@ CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC() {
browser_process_handler_on_context_initialized; browser_process_handler_on_context_initialized;
GetStruct()->on_before_child_process_launch = GetStruct()->on_before_child_process_launch =
browser_process_handler_on_before_child_process_launch; browser_process_handler_on_before_child_process_launch;
GetStruct()->on_render_process_thread_created =
browser_process_handler_on_render_process_thread_created;
GetStruct()->get_print_handler = browser_process_handler_get_print_handler; GetStruct()->get_print_handler = browser_process_handler_get_print_handler;
GetStruct()->on_schedule_message_pump_work = GetStruct()->on_schedule_message_pump_work =
browser_process_handler_on_schedule_message_pump_work; browser_process_handler_on_schedule_message_pump_work;

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory // implementations. See the translator.README.txt file in the tools directory
// for more information. // for more information.
// //
// $hash=41d141e97c1a248bdf7834b583bb417333b55955$ // $hash=fd848ac49661a654620cf32359a7a206937fcb8d$
// //
#include "libcef_dll/cpptoc/render_process_handler_cpptoc.h" #include "libcef_dll/cpptoc/render_process_handler_cpptoc.h"
@ -18,7 +18,6 @@
#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" #include "libcef_dll/ctocpp/dictionary_value_ctocpp.h"
#include "libcef_dll/ctocpp/domnode_ctocpp.h" #include "libcef_dll/ctocpp/domnode_ctocpp.h"
#include "libcef_dll/ctocpp/frame_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/process_message_ctocpp.h"
#include "libcef_dll/ctocpp/v8context_ctocpp.h" #include "libcef_dll/ctocpp/v8context_ctocpp.h"
#include "libcef_dll/ctocpp/v8exception_ctocpp.h" #include "libcef_dll/ctocpp/v8exception_ctocpp.h"
@ -28,24 +27,6 @@ namespace {
// MEMBER FUNCTIONS - Body may be edited by hand. // 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_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(
CefListValueCToCpp::Wrap(extra_info));
}
void CEF_CALLBACK render_process_handler_on_web_kit_initialized( void CEF_CALLBACK render_process_handler_on_web_kit_initialized(
struct _cef_render_process_handler_t* self) { struct _cef_render_process_handler_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -275,8 +256,6 @@ int CEF_CALLBACK render_process_handler_on_process_message_received(
// CONSTRUCTOR - Do not edit by hand. // CONSTRUCTOR - Do not edit by hand.
CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC() { CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC() {
GetStruct()->on_render_thread_created =
render_process_handler_on_render_thread_created;
GetStruct()->on_web_kit_initialized = GetStruct()->on_web_kit_initialized =
render_process_handler_on_web_kit_initialized; render_process_handler_on_web_kit_initialized;
GetStruct()->on_browser_created = render_process_handler_on_browser_created; GetStruct()->on_browser_created = render_process_handler_on_browser_created;

View File

@ -9,12 +9,11 @@
// implementations. See the translator.README.txt file in the tools directory // implementations. See the translator.README.txt file in the tools directory
// for more information. // for more information.
// //
// $hash=622d56aec0a5d6485a586bd6d993df7af4fa2d62$ // $hash=394c9b4009a90393aa15be216b5e44f1bafccdfb$
// //
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h" #include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
#include "libcef_dll/cpptoc/command_line_cpptoc.h" #include "libcef_dll/cpptoc/command_line_cpptoc.h"
#include "libcef_dll/cpptoc/list_value_cpptoc.h"
#include "libcef_dll/ctocpp/print_handler_ctocpp.h" #include "libcef_dll/ctocpp/print_handler_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand. // VIRTUAL METHODS - Body may be edited by hand.
@ -50,25 +49,6 @@ void CefBrowserProcessHandlerCToCpp::OnBeforeChildProcessLaunch(
_struct, CefCommandLineCppToC::Wrap(command_line)); _struct, CefCommandLineCppToC::Wrap(command_line));
} }
NO_SANITIZE("cfi-icall")
void CefBrowserProcessHandlerCToCpp::OnRenderProcessThreadCreated(
CefRefPtr<CefListValue> extra_info) {
cef_browser_process_handler_t* _struct = GetStruct();
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));
}
NO_SANITIZE("cfi-icall") NO_SANITIZE("cfi-icall")
CefRefPtr<CefPrintHandler> CefBrowserProcessHandlerCToCpp::GetPrintHandler() { CefRefPtr<CefPrintHandler> CefBrowserProcessHandlerCToCpp::GetPrintHandler() {
cef_browser_process_handler_t* _struct = GetStruct(); cef_browser_process_handler_t* _struct = GetStruct();

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory // implementations. See the translator.README.txt file in the tools directory
// for more information. // for more information.
// //
// $hash=d07e79689f98b41fd7a0fb8c45dcae12a945cfe4$ // $hash=79e6f729e377f1dca76c076d7c694f07b8e171e6$
// //
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_ #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_
@ -38,8 +38,6 @@ class CefBrowserProcessHandlerCToCpp
void OnContextInitialized() override; void OnContextInitialized() override;
void OnBeforeChildProcessLaunch( void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) override; CefRefPtr<CefCommandLine> command_line) override;
void OnRenderProcessThreadCreated(
CefRefPtr<CefListValue> extra_info) override;
CefRefPtr<CefPrintHandler> GetPrintHandler() override; CefRefPtr<CefPrintHandler> GetPrintHandler() override;
void OnScheduleMessagePumpWork(int64 delay_ms) override; void OnScheduleMessagePumpWork(int64 delay_ms) override;
}; };

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory // implementations. See the translator.README.txt file in the tools directory
// for more information. // for more information.
// //
// $hash=084106863bdaf595427b0d121362e207b15c66bf$ // $hash=86c1554ebf9afc248f432a5240e3f37d89eb1ef6$
// //
#include "libcef_dll/ctocpp/render_process_handler_ctocpp.h" #include "libcef_dll/ctocpp/render_process_handler_ctocpp.h"
@ -17,7 +17,6 @@
#include "libcef_dll/cpptoc/dictionary_value_cpptoc.h" #include "libcef_dll/cpptoc/dictionary_value_cpptoc.h"
#include "libcef_dll/cpptoc/domnode_cpptoc.h" #include "libcef_dll/cpptoc/domnode_cpptoc.h"
#include "libcef_dll/cpptoc/frame_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/process_message_cpptoc.h"
#include "libcef_dll/cpptoc/v8context_cpptoc.h" #include "libcef_dll/cpptoc/v8context_cpptoc.h"
#include "libcef_dll/cpptoc/v8exception_cpptoc.h" #include "libcef_dll/cpptoc/v8exception_cpptoc.h"
@ -26,25 +25,6 @@
// VIRTUAL METHODS - Body may be edited by hand. // VIRTUAL METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
void CefRenderProcessHandlerCToCpp::OnRenderThreadCreated(
CefRefPtr<CefListValue> extra_info) {
cef_render_process_handler_t* _struct = GetStruct();
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,
CefListValueCppToC::Wrap(extra_info));
}
NO_SANITIZE("cfi-icall") NO_SANITIZE("cfi-icall")
void CefRenderProcessHandlerCToCpp::OnWebKitInitialized() { void CefRenderProcessHandlerCToCpp::OnWebKitInitialized() {
cef_render_process_handler_t* _struct = GetStruct(); cef_render_process_handler_t* _struct = GetStruct();

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory // implementations. See the translator.README.txt file in the tools directory
// for more information. // for more information.
// //
// $hash=37559903bacc38b0c955e1471f0d0dbeb79b11a8$ // $hash=0f28e90718cbc42c5b62f213c202296d80d724c0$
// //
#ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_PROCESS_HANDLER_CTOCPP_H_ #ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_PROCESS_HANDLER_CTOCPP_H_
@ -35,7 +35,6 @@ class CefRenderProcessHandlerCToCpp
virtual ~CefRenderProcessHandlerCToCpp(); virtual ~CefRenderProcessHandlerCToCpp();
// CefRenderProcessHandler methods. // CefRenderProcessHandler methods.
void OnRenderThreadCreated(CefRefPtr<CefListValue> extra_info) override;
void OnWebKitInitialized() override; void OnWebKitInitialized() override;
void OnBrowserCreated(CefRefPtr<CefBrowser> browser, void OnBrowserCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDictionaryValue> extra_info) override; CefRefPtr<CefDictionaryValue> extra_info) override;

View File

@ -24,8 +24,7 @@ class ClientRenderDelegate : public ClientAppRenderer::Delegate {
public: public:
ClientRenderDelegate() : last_node_is_editable_(false) {} ClientRenderDelegate() : last_node_is_editable_(false) {}
void OnRenderThreadCreated(CefRefPtr<ClientAppRenderer> app, void OnWebKitInitialized(CefRefPtr<ClientAppRenderer> app) OVERRIDE {
CefRefPtr<CefListValue> extra_info) OVERRIDE {
if (CefCrashReportingEnabled()) { if (CefCrashReportingEnabled()) {
// Set some crash keys for testing purposes. Keys must be defined in the // Set some crash keys for testing purposes. Keys must be defined in the
// "crash_reporter.cfg" file. See cef_crash_util.h for details. // "crash_reporter.cfg" file. See cef_crash_util.h for details.
@ -36,9 +35,7 @@ class ClientRenderDelegate : public ClientAppRenderer::Delegate {
CefSetCrashKeyValue("testkey_large1", "value1_large_renderer"); CefSetCrashKeyValue("testkey_large1", "value1_large_renderer");
CefSetCrashKeyValue("testkey_large2", "value2_large_renderer"); CefSetCrashKeyValue("testkey_large2", "value2_large_renderer");
} }
}
void OnWebKitInitialized(CefRefPtr<ClientAppRenderer> app) OVERRIDE {
// Create the renderer-side router for query handling. // Create the renderer-side router for query handling.
CefMessageRouterConfig config; CefMessageRouterConfig config;
message_router_ = CefMessageRouterRendererSide::Create(config); message_router_ = CefMessageRouterRendererSide::Create(config);

View File

@ -13,11 +13,6 @@ void CreateBrowserDelegates(ClientAppBrowser::DelegateSet& delegates) {
extern void CreateAudioOutputTests(ClientAppBrowser::DelegateSet & delegates); extern void CreateAudioOutputTests(ClientAppBrowser::DelegateSet & delegates);
CreateAudioOutputTests(delegates); CreateAudioOutputTests(delegates);
// Bring in the Navigation tests.
extern void CreateNavigationBrowserTests(ClientAppBrowser::DelegateSet &
delegates);
CreateNavigationBrowserTests(delegates);
// Bring in the plugin tests. // Bring in the plugin tests.
extern void CreatePluginBrowserTests(ClientAppBrowser::DelegateSet & extern void CreatePluginBrowserTests(ClientAppBrowser::DelegateSet &
delegates); delegates);

View File

@ -1042,35 +1042,6 @@ const char kOrderNavMsg[] = "NavigationTest.OrderNav";
const char kOrderNavClosedMsg[] = "NavigationTest.OrderNavClosed"; const char kOrderNavClosedMsg[] = "NavigationTest.OrderNavClosed";
const char kOrderNavTestCmdKey[] = "nav-order-test"; const char kOrderNavTestCmdKey[] = "nav-order-test";
void SetOrderNavExtraInfo(CefRefPtr<CefListValue> extra_info) {
// Arbitrary data for testing.
extra_info->SetBool(0, true);
CefRefPtr<CefDictionaryValue> dict = CefDictionaryValue::Create();
dict->SetInt("key1", 5);
dict->SetString("key2", "test string");
extra_info->SetDictionary(1, dict);
extra_info->SetDouble(2, 5.43322);
extra_info->SetString(3, "some string");
}
// Browser side.
class OrderNavBrowserTest : public ClientAppBrowser::Delegate {
public:
OrderNavBrowserTest() {}
void OnRenderProcessThreadCreated(
CefRefPtr<ClientAppBrowser> app,
CefRefPtr<CefListValue> extra_info) override {
// Some data that we'll check for. Note that this leaks into all renderer
// process test cases, but that shouldn't be an issue since we only check
// the result in this test case.
SetOrderNavExtraInfo(extra_info);
}
protected:
IMPLEMENT_REFCOUNTING(OrderNavBrowserTest);
};
class OrderNavLoadState { class OrderNavLoadState {
public: public:
OrderNavLoadState(bool is_popup, bool browser_side) OrderNavLoadState(bool is_popup, bool browser_side)
@ -1154,21 +1125,7 @@ class OrderNavRendererTest : public ClientAppRenderer::Delegate,
state_main_(false, false), state_main_(false, false),
state_popup_(true, false) {} state_popup_(true, false) {}
void OnRenderThreadCreated(CefRefPtr<ClientAppRenderer> app,
CefRefPtr<CefListValue> extra_info) override {
EXPECT_FALSE(got_render_thread_created_);
EXPECT_FALSE(got_webkit_initialized_);
got_render_thread_created_.yes();
// Verify that |extra_info| transferred successfully.
CefRefPtr<CefListValue> expected = CefListValue::Create();
SetOrderNavExtraInfo(expected);
TestListEqual(expected, extra_info);
}
void OnWebKitInitialized(CefRefPtr<ClientAppRenderer> app) override { void OnWebKitInitialized(CefRefPtr<ClientAppRenderer> app) override {
EXPECT_TRUE(got_render_thread_created_);
EXPECT_FALSE(got_webkit_initialized_); EXPECT_FALSE(got_webkit_initialized_);
got_webkit_initialized_.yes(); got_webkit_initialized_.yes();
@ -1181,7 +1138,6 @@ class OrderNavRendererTest : public ClientAppRenderer::Delegate,
if (!run_test_) if (!run_test_)
return; return;
EXPECT_TRUE(got_render_thread_created_);
EXPECT_TRUE(got_webkit_initialized_); EXPECT_TRUE(got_webkit_initialized_);
if (browser->IsPopup()) { if (browser->IsPopup()) {
@ -1210,7 +1166,6 @@ class OrderNavRendererTest : public ClientAppRenderer::Delegate,
if (!run_test_) if (!run_test_)
return; return;
EXPECT_TRUE(got_render_thread_created_);
EXPECT_TRUE(got_webkit_initialized_); EXPECT_TRUE(got_webkit_initialized_);
if (browser->IsPopup()) { if (browser->IsPopup()) {
@ -1250,7 +1205,6 @@ class OrderNavRendererTest : public ClientAppRenderer::Delegate,
bool isLoading, bool isLoading,
bool canGoBack, bool canGoBack,
bool canGoForward) override { bool canGoForward) override {
EXPECT_TRUE(got_render_thread_created_);
EXPECT_TRUE(got_webkit_initialized_); EXPECT_TRUE(got_webkit_initialized_);
if (browser->IsPopup()) { if (browser->IsPopup()) {
@ -1274,7 +1228,6 @@ class OrderNavRendererTest : public ClientAppRenderer::Delegate,
void OnLoadStart(CefRefPtr<CefBrowser> browser, void OnLoadStart(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
TransitionType transition_type) override { TransitionType transition_type) override {
EXPECT_TRUE(got_render_thread_created_);
EXPECT_TRUE(got_webkit_initialized_); EXPECT_TRUE(got_webkit_initialized_);
if (browser->IsPopup()) { if (browser->IsPopup()) {
@ -1293,7 +1246,6 @@ class OrderNavRendererTest : public ClientAppRenderer::Delegate,
void OnLoadEnd(CefRefPtr<CefBrowser> browser, void OnLoadEnd(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame, CefRefPtr<CefFrame> frame,
int httpStatusCode) override { int httpStatusCode) override {
EXPECT_TRUE(got_render_thread_created_);
EXPECT_TRUE(got_webkit_initialized_); EXPECT_TRUE(got_webkit_initialized_);
if (browser->IsPopup()) { if (browser->IsPopup()) {
@ -1358,7 +1310,6 @@ class OrderNavRendererTest : public ClientAppRenderer::Delegate,
int browser_id_main_; int browser_id_main_;
int browser_id_popup_; int browser_id_popup_;
CefRefPtr<CefBrowser> browser_main_; CefRefPtr<CefBrowser> browser_main_;
TrackCallback got_render_thread_created_;
TrackCallback got_webkit_initialized_; TrackCallback got_webkit_initialized_;
TrackCallback got_browser_created_main_; TrackCallback got_browser_created_main_;
TrackCallback got_browser_destroyed_main_; TrackCallback got_browser_destroyed_main_;
@ -3530,12 +3481,6 @@ TEST(NavigationTest, ExtraInfo) {
ReleaseAndWaitForDestructor(handler); ReleaseAndWaitForDestructor(handler);
} }
// Entry point for creating navigation browser test objects.
// Called from client_app_delegates.cc.
void CreateNavigationBrowserTests(ClientAppBrowser::DelegateSet& delegates) {
delegates.insert(new OrderNavBrowserTest);
}
// Entry point for creating navigation renderer test objects. // Entry point for creating navigation renderer test objects.
// Called from client_app_delegates.cc. // Called from client_app_delegates.cc.
void CreateNavigationRendererTests(ClientAppRenderer::DelegateSet& delegates) { void CreateNavigationRendererTests(ClientAppRenderer::DelegateSet& delegates) {

View File

@ -81,13 +81,6 @@ void ClientAppBrowser::OnBeforeChildProcessLaunch(
(*it)->OnBeforeChildProcessLaunch(this, command_line); (*it)->OnBeforeChildProcessLaunch(this, command_line);
} }
void ClientAppBrowser::OnRenderProcessThreadCreated(
CefRefPtr<CefListValue> extra_info) {
DelegateSet::iterator it = delegates_.begin();
for (; it != delegates_.end(); ++it)
(*it)->OnRenderProcessThreadCreated(this, extra_info);
}
void ClientAppBrowser::OnScheduleMessagePumpWork(int64 delay) { void ClientAppBrowser::OnScheduleMessagePumpWork(int64 delay) {
// Only used when `--external-message-pump` is passed via the command-line. // Only used when `--external-message-pump` is passed via the command-line.
MainMessageLoopExternalPump* message_pump = MainMessageLoopExternalPump* message_pump =

View File

@ -29,10 +29,6 @@ class ClientAppBrowser : public ClientApp, public CefBrowserProcessHandler {
virtual void OnBeforeChildProcessLaunch( virtual void OnBeforeChildProcessLaunch(
CefRefPtr<ClientAppBrowser> app, CefRefPtr<ClientAppBrowser> app,
CefRefPtr<CefCommandLine> command_line) {} CefRefPtr<CefCommandLine> command_line) {}
virtual void OnRenderProcessThreadCreated(
CefRefPtr<ClientAppBrowser> app,
CefRefPtr<CefListValue> extra_info) {}
}; };
typedef std::set<CefRefPtr<Delegate>> DelegateSet; typedef std::set<CefRefPtr<Delegate>> DelegateSet;
@ -60,8 +56,6 @@ class ClientAppBrowser : public ClientApp, public CefBrowserProcessHandler {
void OnContextInitialized() OVERRIDE; void OnContextInitialized() OVERRIDE;
void OnBeforeChildProcessLaunch( void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) OVERRIDE; CefRefPtr<CefCommandLine> command_line) OVERRIDE;
void OnRenderProcessThreadCreated(
CefRefPtr<CefListValue> extra_info) OVERRIDE;
CefRefPtr<CefPrintHandler> GetPrintHandler() OVERRIDE { CefRefPtr<CefPrintHandler> GetPrintHandler() OVERRIDE {
return print_handler_; return print_handler_;
} }

View File

@ -12,13 +12,6 @@ ClientAppRenderer::ClientAppRenderer() {
CreateDelegates(delegates_); CreateDelegates(delegates_);
} }
void ClientAppRenderer::OnRenderThreadCreated(
CefRefPtr<CefListValue> extra_info) {
DelegateSet::iterator it = delegates_.begin();
for (; it != delegates_.end(); ++it)
(*it)->OnRenderThreadCreated(this, extra_info);
}
void ClientAppRenderer::OnWebKitInitialized() { void ClientAppRenderer::OnWebKitInitialized() {
DelegateSet::iterator it = delegates_.begin(); DelegateSet::iterator it = delegates_.begin();
for (; it != delegates_.end(); ++it) for (; it != delegates_.end(); ++it)

View File

@ -20,9 +20,6 @@ class ClientAppRenderer : public ClientApp, public CefRenderProcessHandler {
// constructor. See CefRenderProcessHandler for documentation. // constructor. See CefRenderProcessHandler for documentation.
class Delegate : public virtual CefBaseRefCounted { class Delegate : public virtual CefBaseRefCounted {
public: public:
virtual void OnRenderThreadCreated(CefRefPtr<ClientAppRenderer> app,
CefRefPtr<CefListValue> extra_info) {}
virtual void OnWebKitInitialized(CefRefPtr<ClientAppRenderer> app) {} virtual void OnWebKitInitialized(CefRefPtr<ClientAppRenderer> app) {}
virtual void OnBrowserCreated(CefRefPtr<ClientAppRenderer> app, virtual void OnBrowserCreated(CefRefPtr<ClientAppRenderer> app,
@ -88,7 +85,6 @@ class ClientAppRenderer : public ClientApp, public CefRenderProcessHandler {
} }
// CefRenderProcessHandler methods. // CefRenderProcessHandler methods.
void OnRenderThreadCreated(CefRefPtr<CefListValue> extra_info) OVERRIDE;
void OnWebKitInitialized() OVERRIDE; void OnWebKitInitialized() OVERRIDE;
void OnBrowserCreated(CefRefPtr<CefBrowser> browser, void OnBrowserCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDictionaryValue> extra_info) OVERRIDE; CefRefPtr<CefDictionaryValue> extra_info) OVERRIDE;