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

Unified Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 1385333002: [Chromecast] Cleanup the API for creating MediaPipelineBackend. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/browser/cast_browser_main_parts.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14fac696276e2735b1b030f54a0f130cc1272c5c..027d6224c9c1d7df5c12757c7b1f958e517cce5c 100644
--- a/chromecast/browser/cast_browser_main_parts.cc
+++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -213,13 +213,11 @@ void AddDefaultCommandLineSwitches(base::CommandLine* command_line) {
CastBrowserMainParts::CastBrowserMainParts(
const content::MainFunctionParams& parameters,
- URLRequestContextFactory* url_request_context_factory,
- scoped_ptr<::media::AudioManagerFactory> audio_manager_factory)
+ URLRequestContextFactory* url_request_context_factory)
: BrowserMainParts(),
cast_browser_process_(new CastBrowserProcess()),
parameters_(parameters),
url_request_context_factory_(url_request_context_factory),
- audio_manager_factory_(audio_manager_factory.Pass()),
net_log_(new CastNetLog()) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
AddDefaultCommandLineSwitches(command_line);
@@ -236,10 +234,6 @@ void CastBrowserMainParts::PreMainMessageLoopStart() {
// Net/DNS metrics.
metrics::PreregisterAllGroupedHistograms();
- // Set the platform's implementation of AudioManagerFactory.
- if (audio_manager_factory_)
- ::media::AudioManager::SetFactory(audio_manager_factory_.release());
-
#if defined(OS_ANDROID)
net::NetworkChangeNotifier::SetFactory(
new net::NetworkChangeNotifierFactoryAndroid());
@@ -273,6 +267,12 @@ int CastBrowserMainParts::PreCreateThreads() {
CHECK(PathService::Get(DIR_CAST_HOME, &home_dir));
if (!base::CreateDirectory(home_dir))
return 1;
+
+ // AudioManager is created immediately after threads are created, requiring
+ // AudioManagerFactory to be set beforehand.
+ scoped_ptr< ::media::AudioManagerFactory> audio_manager_factory =
+ cast_browser_process_->browser_client()->CreateAudioManagerFactory();
+ ::media::AudioManager::SetFactory(audio_manager_factory.release());
#endif
#if defined(USE_AURA)
« no previous file with comments | « chromecast/browser/cast_browser_main_parts.h ('k') | chromecast/browser/cast_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698