Chromium Code Reviews| 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 <signal.h> | 7 #include <signal.h> |
| 8 #include <sys/prctl.h> | 8 #include <sys/prctl.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; | 222 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; |
| 223 | 223 |
| 224 cast_browser_process_->SetRemoteDebuggingServer( | 224 cast_browser_process_->SetRemoteDebuggingServer( |
| 225 make_scoped_ptr(new RemoteDebuggingServer())); | 225 make_scoped_ptr(new RemoteDebuggingServer())); |
| 226 | 226 |
| 227 cast_browser_process_->SetCastService(CastService::Create( | 227 cast_browser_process_->SetCastService(CastService::Create( |
| 228 cast_browser_process_->browser_context(), | 228 cast_browser_process_->browser_context(), |
| 229 cast_browser_process_->pref_service(), | 229 cast_browser_process_->pref_service(), |
| 230 cast_browser_process_->metrics_service_client(), | 230 cast_browser_process_->metrics_service_client(), |
| 231 url_request_context_factory_->GetSystemGetter())); | 231 url_request_context_factory_->GetSystemGetter())); |
| 232 cast_browser_process_->cast_service()->Initialize(); | |
| 232 | 233 |
| 234 // Initializing metrics service and network delegates must happen after cast | |
| 235 // service is intialized because CastMetricsServiceClient and | |
| 236 // CastNetworkDelegate may use components initialized by cast service. | |
|
lcwu1
2015/02/19 23:20:29
nit: remove 'may' because we know for a fact that
gunsch
2015/02/19 23:21:46
Doesn't that depend on the particular CastService
byungchul
2015/02/19 23:29:01
May be possible if sys info supports Initialized()
| |
| 233 cast_browser_process_->metrics_service_client() | 237 cast_browser_process_->metrics_service_client() |
| 234 ->Initialize(cast_browser_process_->cast_service()); | 238 ->Initialize(cast_browser_process_->cast_service()); |
| 235 | |
| 236 cast_browser_process_->cast_service()->Initialize(); | |
| 237 | |
| 238 // Initializing network delegates must happen after cast service is | |
| 239 // initialized because CastNetworkDelegate may use components initialized by | |
| 240 // cast service. | |
| 241 url_request_context_factory_->InitializeNetworkDelegates(); | 239 url_request_context_factory_->InitializeNetworkDelegates(); |
| 242 } | 240 } |
| 243 | 241 |
| 244 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { | 242 bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 245 cast_browser_process_->cast_service()->Start(); | 243 cast_browser_process_->cast_service()->Start(); |
| 246 | 244 |
| 247 base::RunLoop run_loop; | 245 base::RunLoop run_loop; |
| 248 base::Closure quit_closure(run_loop.QuitClosure()); | 246 base::Closure quit_closure(run_loop.QuitClosure()); |
| 249 RegisterClosureOnSignal(quit_closure); | 247 RegisterClosureOnSignal(quit_closure); |
| 250 | 248 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 262 } | 260 } |
| 263 | 261 |
| 264 void CastBrowserMainParts::PostMainMessageLoopRun() { | 262 void CastBrowserMainParts::PostMainMessageLoopRun() { |
| 265 cast_browser_process_->cast_service()->Finalize(); | 263 cast_browser_process_->cast_service()->Finalize(); |
| 266 cast_browser_process_->metrics_service_client()->Finalize(); | 264 cast_browser_process_->metrics_service_client()->Finalize(); |
| 267 cast_browser_process_.reset(); | 265 cast_browser_process_.reset(); |
| 268 } | 266 } |
| 269 | 267 |
| 270 } // namespace shell | 268 } // namespace shell |
| 271 } // namespace chromecast | 269 } // namespace chromecast |
| OLD | NEW |