OLD | NEW |
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 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple()); | 430 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple()); |
431 metrics::RegisterPrefs(pref_registry.get()); | 431 metrics::RegisterPrefs(pref_registry.get()); |
432 PrefProxyConfigTrackerImpl::RegisterPrefs(pref_registry.get()); | 432 PrefProxyConfigTrackerImpl::RegisterPrefs(pref_registry.get()); |
433 cast_browser_process_->SetPrefService( | 433 cast_browser_process_->SetPrefService( |
434 PrefServiceHelper::CreatePrefService(pref_registry.get())); | 434 PrefServiceHelper::CreatePrefService(pref_registry.get())); |
435 | 435 |
436 #if !defined(OS_ANDROID) | 436 #if !defined(OS_ANDROID) |
437 memory_pressure_monitor_.reset(new CastMemoryPressureMonitor()); | 437 memory_pressure_monitor_.reset(new CastMemoryPressureMonitor()); |
438 #endif // defined(OS_ANDROID) | 438 #endif // defined(OS_ANDROID) |
439 | 439 |
| 440 cast_browser_process_->SetNetLog(net_log_.get()); |
| 441 url_request_context_factory_->InitializeOnUIThread(net_log_.get()); |
| 442 |
440 cast_browser_process_->SetConnectivityChecker(ConnectivityChecker::Create( | 443 cast_browser_process_->SetConnectivityChecker(ConnectivityChecker::Create( |
441 content::BrowserThread::GetTaskRunnerForThread( | 444 content::BrowserThread::GetTaskRunnerForThread( |
442 content::BrowserThread::IO), | 445 content::BrowserThread::IO), |
443 url_request_context_factory_->GetSystemGetter())); | 446 url_request_context_factory_->GetSystemGetter())); |
444 | 447 |
445 cast_browser_process_->SetNetLog(net_log_.get()); | |
446 | |
447 url_request_context_factory_->InitializeOnUIThread(net_log_.get()); | |
448 | |
449 cast_browser_process_->SetBrowserContext( | 448 cast_browser_process_->SetBrowserContext( |
450 base::MakeUnique<CastBrowserContext>(url_request_context_factory_)); | 449 base::MakeUnique<CastBrowserContext>(url_request_context_factory_)); |
451 cast_browser_process_->SetMetricsServiceClient( | 450 cast_browser_process_->SetMetricsServiceClient( |
452 metrics::CastMetricsServiceClient::Create( | 451 metrics::CastMetricsServiceClient::Create( |
453 content::BrowserThread::GetBlockingPool(), | 452 content::BrowserThread::GetBlockingPool(), |
454 cast_browser_process_->pref_service(), | 453 cast_browser_process_->pref_service(), |
455 content::BrowserContext::GetDefaultStoragePartition( | 454 content::BrowserContext::GetDefaultStoragePartition( |
456 cast_browser_process_->browser_context())-> | 455 cast_browser_process_->browser_context())-> |
457 GetURLRequestContext())); | 456 GetURLRequestContext())); |
458 | 457 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 555 |
557 void CastBrowserMainParts::PostDestroyThreads() { | 556 void CastBrowserMainParts::PostDestroyThreads() { |
558 #if !defined(OS_ANDROID) | 557 #if !defined(OS_ANDROID) |
559 media_resource_tracker_->FinalizeAndDestroy(); | 558 media_resource_tracker_->FinalizeAndDestroy(); |
560 media_resource_tracker_ = nullptr; | 559 media_resource_tracker_ = nullptr; |
561 #endif | 560 #endif |
562 } | 561 } |
563 | 562 |
564 } // namespace shell | 563 } // namespace shell |
565 } // namespace chromecast | 564 } // namespace chromecast |
OLD | NEW |