Chromium Code Reviews| Index: chromecast/browser/cast_browser_main_parts.cc |
| diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc |
| index 2c2e81ccf62d50d57bc9879f30673459b970cbc4..b85750950b925dfbc056e527d9b824771594b525 100644 |
| --- a/chromecast/browser/cast_browser_main_parts.cc |
| +++ b/chromecast/browser/cast_browser_main_parts.cc |
| @@ -44,6 +44,7 @@ |
| namespace { |
| +#if !defined(OS_ANDROID) |
| int kSignalsToRunClosure[] = { SIGTERM, SIGINT, }; |
| // Closure to run on SIGTERM and SIGINT. |
| @@ -82,6 +83,7 @@ void RegisterClosureOnSignal(const base::Closure& closure) { |
| // Get the first signal to exit when the parent process dies. |
| prctl(PR_SET_PDEATHSIG, kSignalsToRunClosure[0]); |
| } |
| +#endif // !defined(OS_ANDROID) |
| } // namespace |
| @@ -245,11 +247,16 @@ void CastBrowserMainParts::PreMainMessageLoopRun() { |
| cast_browser_process_->metrics_service_client() |
| ->Initialize(cast_browser_process_->cast_service()); |
| url_request_context_factory_->InitializeNetworkDelegates(); |
| -} |
| -bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| cast_browser_process_->cast_service()->Start(); |
| +} |
| +bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| +#if defined(OS_ANDROID) |
| + // Android does not use native main MessageLoop. |
| + NOTREACHED(); |
| + return true; |
| +#else |
| base::RunLoop run_loop; |
| base::Closure quit_closure(run_loop.QuitClosure()); |
| RegisterClosureOnSignal(quit_closure); |
| @@ -265,12 +272,18 @@ bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| cast_browser_process_->cast_service()->Stop(); |
| return true; |
| +#endif |
| } |
| void CastBrowserMainParts::PostMainMessageLoopRun() { |
| +#if defined(OS_ANDROID) |
| + // Android does not use native main MessageLoop. |
| + NOTREACHED(); |
| +#else |
| cast_browser_process_->cast_service()->Finalize(); |
| cast_browser_process_->metrics_service_client()->Finalize(); |
| cast_browser_process_.reset(); |
|
lcwu1
2015/02/25 21:48:27
Where does the tear-down of the cast objects take
gunsch
2015/02/25 21:58:57
It doesn't. For a similar comment, see:
https://co
|
| +#endif |
| } |
| } // namespace shell |