Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 1081673004: Chromecast startup race: don't add filter before HostResolver exists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicitly do I/O-thread initialization Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/browser/cast_browser_main_parts.h" 5 #include "chromecast/browser/cast_browser_main_parts.h"
6 6
7 #if !defined(OS_ANDROID) 7 #if !defined(OS_ANDROID)
8 #include <signal.h> 8 #include <signal.h>
9 #include <sys/prctl.h> 9 #include <sys/prctl.h>
10 #endif 10 #endif
(...skipping 16 matching lines...) Expand all
27 #include "chromecast/browser/pref_service_helper.h" 27 #include "chromecast/browser/pref_service_helper.h"
28 #include "chromecast/browser/service/cast_service.h" 28 #include "chromecast/browser/service/cast_service.h"
29 #include "chromecast/browser/url_request_context_factory.h" 29 #include "chromecast/browser/url_request_context_factory.h"
30 #include "chromecast/common/chromecast_switches.h" 30 #include "chromecast/common/chromecast_switches.h"
31 #include "chromecast/common/platform_client_auth.h" 31 #include "chromecast/common/platform_client_auth.h"
32 #include "chromecast/net/connectivity_checker.h" 32 #include "chromecast/net/connectivity_checker.h"
33 #include "content/public/browser/browser_thread.h" 33 #include "content/public/browser/browser_thread.h"
34 #include "content/public/common/content_switches.h" 34 #include "content/public/common/content_switches.h"
35 #include "media/base/browser_cdm_factory.h" 35 #include "media/base/browser_cdm_factory.h"
36 #include "media/base/media_switches.h" 36 #include "media/base/media_switches.h"
37 #include "net/url_request/url_request_context_getter.h"
37 38
38 #if defined(OS_ANDROID) 39 #if defined(OS_ANDROID)
39 #include "chromecast/crash/android/crash_handler.h" 40 #include "chromecast/crash/android/crash_handler.h"
40 #include "components/crash/browser/crash_dump_manager_android.h" 41 #include "components/crash/browser/crash_dump_manager_android.h"
41 #include "net/android/network_change_notifier_factory_android.h" 42 #include "net/android/network_change_notifier_factory_android.h"
42 #else 43 #else
43 #include "chromecast/browser/media/cast_browser_cdm_factory.h" 44 #include "chromecast/browser/media/cast_browser_cdm_factory.h"
44 #endif 45 #endif
45 46
46 #if defined(USE_AURA) 47 #if defined(USE_AURA)
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline)) 267 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline))
267 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory); 268 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory);
268 #endif // !defined(OS_ANDROID) 269 #endif // !defined(OS_ANDROID)
269 270
270 cast_browser_process_->SetConnectivityChecker( 271 cast_browser_process_->SetConnectivityChecker(
271 make_scoped_refptr(new ConnectivityChecker( 272 make_scoped_refptr(new ConnectivityChecker(
272 content::BrowserThread::GetMessageLoopProxyForThread( 273 content::BrowserThread::GetMessageLoopProxyForThread(
273 content::BrowserThread::IO)))); 274 content::BrowserThread::IO))));
274 275
275 url_request_context_factory_->InitializeOnUIThread(); 276 url_request_context_factory_->InitializeOnUIThread();
277 // Forcibly trigger I/O-thread initialization.
278 content::BrowserThread::PostTask(
279 content::BrowserThread::IO,
280 FROM_HERE,
281 base::Bind(base::IgnoreResult(
282 &net::URLRequestContextGetter::GetURLRequestContext),
283 base::Unretained(
284 url_request_context_factory_->GetSystemGetter())));
byungchul 2015/04/17 17:56:17 I would call this in CastContentBrowserClient::Ren
gunsch 2015/04/17 18:24:42 SGTM. I think CastContentBrowserClient is the only
276 285
277 cast_browser_process_->SetBrowserContext( 286 cast_browser_process_->SetBrowserContext(
278 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_))); 287 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_)));
279 cast_browser_process_->SetMetricsServiceClient( 288 cast_browser_process_->SetMetricsServiceClient(
280 metrics::CastMetricsServiceClient::Create( 289 metrics::CastMetricsServiceClient::Create(
281 content::BrowserThread::GetBlockingPool(), 290 content::BrowserThread::GetBlockingPool(),
282 cast_browser_process_->pref_service(), 291 cast_browser_process_->pref_service(),
283 cast_browser_process_->browser_context()->GetRequestContext())); 292 cast_browser_process_->browser_context()->GetRequestContext()));
284 293
285 if (!PlatformClientAuth::Initialize()) 294 if (!PlatformClientAuth::Initialize())
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 #else 351 #else
343 cast_browser_process_->cast_service()->Finalize(); 352 cast_browser_process_->cast_service()->Finalize();
344 cast_browser_process_->metrics_service_client()->Finalize(); 353 cast_browser_process_->metrics_service_client()->Finalize();
345 cast_browser_process_.reset(); 354 cast_browser_process_.reset();
346 DeregisterKillOnAlarm(); 355 DeregisterKillOnAlarm();
347 #endif 356 #endif
348 } 357 }
349 358
350 } // namespace shell 359 } // namespace shell
351 } // namespace chromecast 360 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698