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

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

View File

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

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=084106863bdaf595427b0d121362e207b15c66bf$
// $hash=86c1554ebf9afc248f432a5240e3f37d89eb1ef6$
//
#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/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/v8context_cpptoc.h"
#include "libcef_dll/cpptoc/v8exception_cpptoc.h"
@@ -26,25 +25,6 @@
// 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")
void CefRenderProcessHandlerCToCpp::OnWebKitInitialized() {
cef_render_process_handler_t* _struct = GetStruct();

View File

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