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

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

Issue 886583002: Chromecast: connect CastBrowserCdmFactory during startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | no next file » | 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 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
11 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/prefs/pref_registry_simple.h" 13 #include "base/prefs/pref_registry_simple.h"
14 #include "base/run_loop.h" 14 #include "base/run_loop.h"
15 #include "cc/base/switches.h" 15 #include "cc/base/switches.h"
16 #include "chromecast/base/metrics/cast_metrics_helper.h" 16 #include "chromecast/base/metrics/cast_metrics_helper.h"
17 #include "chromecast/base/metrics/grouped_histogram.h" 17 #include "chromecast/base/metrics/grouped_histogram.h"
18 #include "chromecast/browser/cast_browser_context.h" 18 #include "chromecast/browser/cast_browser_context.h"
19 #include "chromecast/browser/cast_browser_process.h" 19 #include "chromecast/browser/cast_browser_process.h"
20 #include "chromecast/browser/devtools/remote_debugging_server.h" 20 #include "chromecast/browser/devtools/remote_debugging_server.h"
21 #include "chromecast/browser/media/cast_browser_cdm_factory.h"
21 #include "chromecast/browser/metrics/cast_metrics_prefs.h" 22 #include "chromecast/browser/metrics/cast_metrics_prefs.h"
22 #include "chromecast/browser/metrics/cast_metrics_service_client.h" 23 #include "chromecast/browser/metrics/cast_metrics_service_client.h"
23 #include "chromecast/browser/pref_service_helper.h" 24 #include "chromecast/browser/pref_service_helper.h"
24 #include "chromecast/browser/service/cast_service.h" 25 #include "chromecast/browser/service/cast_service.h"
25 #include "chromecast/browser/url_request_context_factory.h" 26 #include "chromecast/browser/url_request_context_factory.h"
26 #include "chromecast/common/cast_paths.h" 27 #include "chromecast/common/cast_paths.h"
28 #include "chromecast/common/chromecast_switches.h"
27 #include "chromecast/common/platform_client_auth.h" 29 #include "chromecast/common/platform_client_auth.h"
28 #include "chromecast/net/network_change_notifier_cast.h" 30 #include "chromecast/net/network_change_notifier_cast.h"
29 #include "chromecast/net/network_change_notifier_factory_cast.h" 31 #include "chromecast/net/network_change_notifier_factory_cast.h"
30 #include "content/public/browser/browser_thread.h" 32 #include "content/public/browser/browser_thread.h"
31 #include "content/public/common/content_switches.h" 33 #include "content/public/common/content_switches.h"
34 #include "media/base/browser_cdm_factory.h"
32 #include "media/base/media_switches.h" 35 #include "media/base/media_switches.h"
33 36
34 #if defined(OS_ANDROID) 37 #if defined(OS_ANDROID)
35 #include "chromecast/crash/android/crash_handler.h" 38 #include "chromecast/crash/android/crash_handler.h"
36 #include "components/crash/browser/crash_dump_manager_android.h" 39 #include "components/crash/browser/crash_dump_manager_android.h"
37 #include "net/android/network_change_notifier_factory_android.h" 40 #include "net/android/network_change_notifier_factory_android.h"
38 #endif 41 #endif
39 42
40 namespace { 43 namespace {
41 44
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 #endif // !defined(OS_ANDROID) 176 #endif // !defined(OS_ANDROID)
174 return 0; 177 return 0;
175 } 178 }
176 179
177 void CastBrowserMainParts::PreMainMessageLoopRun() { 180 void CastBrowserMainParts::PreMainMessageLoopRun() {
178 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple()); 181 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple());
179 metrics::RegisterPrefs(pref_registry.get()); 182 metrics::RegisterPrefs(pref_registry.get());
180 cast_browser_process_->SetPrefService( 183 cast_browser_process_->SetPrefService(
181 PrefServiceHelper::CreatePrefService(pref_registry.get())); 184 PrefServiceHelper::CreatePrefService(pref_registry.get()));
182 185
186 #if !defined(OS_ANDROID)
187 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
188 if (cmd_line->HasSwitch(switches::kEnableCmaMediaPipeline))
189 ::media::SetBrowserCdmFactory(new media::CastBrowserCdmFactory);
190 #endif // !defined(OS_ANDROID)
191
183 url_request_context_factory_->InitializeOnUIThread(); 192 url_request_context_factory_->InitializeOnUIThread();
184 193
185 cast_browser_process_->SetBrowserContext( 194 cast_browser_process_->SetBrowserContext(
186 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_))); 195 make_scoped_ptr(new CastBrowserContext(url_request_context_factory_)));
187 cast_browser_process_->SetMetricsServiceClient( 196 cast_browser_process_->SetMetricsServiceClient(
188 metrics::CastMetricsServiceClient::Create( 197 metrics::CastMetricsServiceClient::Create(
189 content::BrowserThread::GetBlockingPool(), 198 content::BrowserThread::GetBlockingPool(),
190 cast_browser_process_->pref_service(), 199 cast_browser_process_->pref_service(),
191 cast_browser_process_->browser_context()->GetRequestContext())); 200 cast_browser_process_->browser_context()->GetRequestContext()));
192 201
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 252 }
244 253
245 void CastBrowserMainParts::PostMainMessageLoopRun() { 254 void CastBrowserMainParts::PostMainMessageLoopRun() {
246 cast_browser_process_->cast_service()->Finalize(); 255 cast_browser_process_->cast_service()->Finalize();
247 cast_browser_process_->metrics_service_client()->Finalize(); 256 cast_browser_process_->metrics_service_client()->Finalize();
248 cast_browser_process_.reset(); 257 cast_browser_process_.reset();
249 } 258 }
250 259
251 } // namespace shell 260 } // namespace shell
252 } // namespace chromecast 261 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698