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

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

Issue 925183003: [Chromecast] Add connectivity checking for Chromecast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments in patchset 1 Created 5 years, 10 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_browser_process.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 #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 10 matching lines...) Expand all
21 #include "chromecast/browser/devtools/remote_debugging_server.h" 21 #include "chromecast/browser/devtools/remote_debugging_server.h"
22 #include "chromecast/browser/media/cast_browser_cdm_factory.h" 22 #include "chromecast/browser/media/cast_browser_cdm_factory.h"
23 #include "chromecast/browser/metrics/cast_metrics_prefs.h" 23 #include "chromecast/browser/metrics/cast_metrics_prefs.h"
24 #include "chromecast/browser/metrics/cast_metrics_service_client.h" 24 #include "chromecast/browser/metrics/cast_metrics_service_client.h"
25 #include "chromecast/browser/pref_service_helper.h" 25 #include "chromecast/browser/pref_service_helper.h"
26 #include "chromecast/browser/service/cast_service.h" 26 #include "chromecast/browser/service/cast_service.h"
27 #include "chromecast/browser/url_request_context_factory.h" 27 #include "chromecast/browser/url_request_context_factory.h"
28 #include "chromecast/common/cast_paths.h" 28 #include "chromecast/common/cast_paths.h"
29 #include "chromecast/common/chromecast_switches.h" 29 #include "chromecast/common/chromecast_switches.h"
30 #include "chromecast/common/platform_client_auth.h" 30 #include "chromecast/common/platform_client_auth.h"
31 #include "chromecast/net/connectivity_checker.h"
31 #include "chromecast/net/network_change_notifier_cast.h" 32 #include "chromecast/net/network_change_notifier_cast.h"
32 #include "chromecast/net/network_change_notifier_factory_cast.h" 33 #include "chromecast/net/network_change_notifier_factory_cast.h"
33 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
34 #include "content/public/common/content_switches.h" 35 #include "content/public/common/content_switches.h"
35 #include "media/base/browser_cdm_factory.h" 36 #include "media/base/browser_cdm_factory.h"
36 #include "media/base/media_switches.h" 37 #include "media/base/media_switches.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"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 metrics::RegisterPrefs(pref_registry.get()); 202 metrics::RegisterPrefs(pref_registry.get());
202 cast_browser_process_->SetPrefService( 203 cast_browser_process_->SetPrefService(
203 PrefServiceHelper::CreatePrefService(pref_registry.get())); 204 PrefServiceHelper::CreatePrefService(pref_registry.get()));
204 205
205 #if !defined(OS_ANDROID) 206 #if !defined(OS_ANDROID)
206 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 207 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
207 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline)) 208 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline))
208 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory); 209 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory);
209 #endif // !defined(OS_ANDROID) 210 #endif // !defined(OS_ANDROID)
210 211
212 cast_browser_process_->SetConnectivityChecker(
213 make_scoped_refptr(new ConnectivityChecker(
214 content::BrowserThread::GetMessageLoopProxyForThread(
215 content::BrowserThread::FILE))));
216
211 url_request_context_factory_->InitializeOnUIThread(); 217 url_request_context_factory_->InitializeOnUIThread();
212 218
213 cast_browser_process_->SetBrowserContext( 219 cast_browser_process_->SetBrowserContext(
214 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_))); 220 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_)));
215 cast_browser_process_->SetMetricsServiceClient( 221 cast_browser_process_->SetMetricsServiceClient(
216 metrics::CastMetricsServiceClient::Create( 222 metrics::CastMetricsServiceClient::Create(
217 content::BrowserThread::GetBlockingPool(), 223 content::BrowserThread::GetBlockingPool(),
218 cast_browser_process_->pref_service(), 224 cast_browser_process_->pref_service(),
219 cast_browser_process_->browser_context()->GetRequestContext())); 225 cast_browser_process_->browser_context()->GetRequestContext()));
220 226
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 268 }
263 269
264 void CastBrowserMainParts::PostMainMessageLoopRun() { 270 void CastBrowserMainParts::PostMainMessageLoopRun() {
265 cast_browser_process_->cast_service()->Finalize(); 271 cast_browser_process_->cast_service()->Finalize();
266 cast_browser_process_->metrics_service_client()->Finalize(); 272 cast_browser_process_->metrics_service_client()->Finalize();
267 cast_browser_process_.reset(); 273 cast_browser_process_.reset();
268 } 274 }
269 275
270 } // namespace shell 276 } // namespace shell
271 } // namespace chromecast 277 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | chromecast/browser/cast_browser_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698