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

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

Issue 606513002: Pass the system url request context getter to the cast service so that it can be used by various sy… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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/shell/browser/cast_browser_main_parts.h" 5 #include "chromecast/shell/browser/cast_browser_main_parts.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "chromecast/common/chromecast_config.h" 10 #include "chromecast/common/chromecast_config.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 cast_browser_process_->SetMetricsServiceClient( 95 cast_browser_process_->SetMetricsServiceClient(
96 metrics::CastMetricsServiceClient::Create( 96 metrics::CastMetricsServiceClient::Create(
97 content::BrowserThread::GetBlockingPool(), 97 content::BrowserThread::GetBlockingPool(),
98 ChromecastConfig::GetInstance()->pref_service(), 98 ChromecastConfig::GetInstance()->pref_service(),
99 cast_browser_process_->browser_context()->GetRequestContext())); 99 cast_browser_process_->browser_context()->GetRequestContext()));
100 cast_browser_process_->SetRemoteDebuggingServer(new RemoteDebuggingServer()); 100 cast_browser_process_->SetRemoteDebuggingServer(new RemoteDebuggingServer());
101 101
102 InitializeWebUI(); 102 InitializeWebUI();
103 103
104 cast_browser_process_->SetCastService( 104 cast_browser_process_->SetCastService(
105 CastService::Create(cast_browser_process_->browser_context())); 105 CastService::Create(cast_browser_process_->browser_context(),
106 url_request_context_factory_->GetSystemGetter()));
106 cast_browser_process_->cast_service()->Start(); 107 cast_browser_process_->cast_service()->Start();
107 } 108 }
108 109
109 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { 110 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) {
110 // If parameters_.ui_task is not NULL, we are running browser tests. In this 111 // If parameters_.ui_task is not NULL, we are running browser tests. In this
111 // case, the browser's main message loop will not run. 112 // case, the browser's main message loop will not run.
112 if (parameters_.ui_task) { 113 if (parameters_.ui_task) {
113 parameters_.ui_task->Run(); 114 parameters_.ui_task->Run();
114 } else { 115 } else {
115 base::MessageLoopForUI::current()->Run(); 116 base::MessageLoopForUI::current()->Run();
116 } 117 }
117 return true; 118 return true;
118 } 119 }
119 120
120 void CastBrowserMainParts::PostMainMessageLoopRun() { 121 void CastBrowserMainParts::PostMainMessageLoopRun() {
121 cast_browser_process_->cast_service()->Stop(); 122 cast_browser_process_->cast_service()->Stop();
122 cast_browser_process_.reset(); 123 cast_browser_process_.reset();
123 } 124 }
124 125
125 } // namespace shell 126 } // namespace shell
126 } // namespace chromecast 127 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698