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:
@@ -229,6 +229,14 @@ void ClientApp::OnBeforeChildProcessLaunch(
|
||||
(*it)->OnBeforeChildProcessLaunch(this, command_line);
|
||||
}
|
||||
|
||||
void ClientApp::OnRenderProcessThreadCreated(
|
||||
CefRefPtr<CefListValue> extra_info) {
|
||||
// Execute delegate callbacks.
|
||||
BrowserDelegateSet::iterator it = browser_delegates_.begin();
|
||||
for (; it != browser_delegates_.end(); ++it)
|
||||
(*it)->OnRenderProcessThreadCreated(this, extra_info);
|
||||
}
|
||||
|
||||
void ClientApp::GetProxyForUrl(const CefString& url,
|
||||
CefProxyInfo& proxy_info) {
|
||||
proxy_info.proxyType = proxy_type_;
|
||||
@@ -236,11 +244,11 @@ void ClientApp::GetProxyForUrl(const CefString& url,
|
||||
CefString(&proxy_info.proxyList) = proxy_config_;
|
||||
}
|
||||
|
||||
void ClientApp::OnRenderThreadCreated() {
|
||||
void ClientApp::OnRenderThreadCreated(CefRefPtr<CefListValue> extra_info) {
|
||||
// Execute delegate callbacks.
|
||||
RenderDelegateSet::iterator it = render_delegates_.begin();
|
||||
for (; it != render_delegates_.end(); ++it)
|
||||
(*it)->OnRenderThreadCreated(this);
|
||||
(*it)->OnRenderThreadCreated(this, extra_info);
|
||||
}
|
||||
|
||||
void ClientApp::OnWebKitInitialized() {
|
||||
|
@@ -29,12 +29,22 @@ class ClientApp : public CefApp,
|
||||
}
|
||||
|
||||
// Called on the browser process IO thread before a child process is
|
||||
// launched Provides an opportunity to modify the child process command
|
||||
// line.
|
||||
// launched. Provides an opportunity to modify the child process command
|
||||
// line. Do not keep a reference to |command_line| outside of this method.
|
||||
virtual void OnBeforeChildProcessLaunch(
|
||||
CefRefPtr<ClientApp> app,
|
||||
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.
|
||||
virtual void OnRenderProcessThreadCreated(
|
||||
CefRefPtr<ClientApp> app,
|
||||
CefRefPtr<CefListValue> extra_info) {
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::set<CefRefPtr<BrowserDelegate> > BrowserDelegateSet;
|
||||
@@ -45,7 +55,8 @@ class ClientApp : public CefApp,
|
||||
class RenderDelegate : public virtual CefBase {
|
||||
public:
|
||||
// Called after the render process main thread has been created.
|
||||
virtual void OnRenderThreadCreated(CefRefPtr<ClientApp> app) {
|
||||
virtual void OnRenderThreadCreated(CefRefPtr<ClientApp> app,
|
||||
CefRefPtr<CefListValue> extra_info) {
|
||||
}
|
||||
|
||||
// Called when WebKit is initialized. Used to register V8 extensions.
|
||||
@@ -177,13 +188,16 @@ class ClientApp : public CefApp,
|
||||
virtual void OnContextInitialized() OVERRIDE;
|
||||
virtual void OnBeforeChildProcessLaunch(
|
||||
CefRefPtr<CefCommandLine> command_line) OVERRIDE;
|
||||
virtual void OnRenderProcessThreadCreated(CefRefPtr<CefListValue> extra_info)
|
||||
OVERRIDE;
|
||||
|
||||
// CefProxyHandler methods.
|
||||
virtual void GetProxyForUrl(const CefString& url,
|
||||
CefProxyInfo& proxy_info) OVERRIDE;
|
||||
|
||||
// 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