Fix race condition during V8 proxy initialization (issue #912).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1252 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2013-05-08 18:21:18 +00:00
parent 2801cfd5b1
commit 943bfb9103

View File

@ -93,16 +93,19 @@ int CefBrowserMainParts::PreCreateThreads() {
void CefBrowserMainParts::PreMainMessageLoopRun() { void CefBrowserMainParts::PreMainMessageLoopRun() {
browser_context_.reset(new CefBrowserContext()); browser_context_.reset(new CefBrowserContext());
// Initialize the request context getter. // Initialize the proxy configuration service. This needs to occur before
_Context->set_request_context(browser_context_->GetRequestContext()); // CefURLRequestContextGetter::GetURLRequestContext() is called for the
// first time.
// Initialize proxy configuration service.
ChromeProxyConfigService* chrome_proxy_config_service = ChromeProxyConfigService* chrome_proxy_config_service =
ProxyServiceFactory::CreateProxyConfigService(); ProxyServiceFactory::CreateProxyConfigService();
proxy_config_service_.reset(chrome_proxy_config_service); proxy_config_service_.reset(chrome_proxy_config_service);
pref_proxy_config_tracker_->SetChromeProxyConfigService( pref_proxy_config_tracker_->SetChromeProxyConfigService(
chrome_proxy_config_service); chrome_proxy_config_service);
// Initialize the request context getter. This indirectly triggers a call
// to CefURLRequestContextGetter::GetURLRequestContext() on the IO thread.
_Context->set_request_context(browser_context_->GetRequestContext());
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
std::string port_str = std::string port_str =