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

Unified Diff: chromecast/browser/cast_browser_main_parts.cc

Issue 1113053002: Set the AudioManager factory before the browser main loop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup + naming Created 5 years, 8 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 1c0ca15f666b4b12fd6f83723ce5ef0a60597811..7922d74bd061ded1b9a2d2bf1e7d0f71b5f319f2 100644
--- a/chromecast/browser/cast_browser_main_parts.cc
+++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -4,6 +4,7 @@
#include "chromecast/browser/cast_browser_main_parts.h"
+#include <string>
#if !defined(OS_ANDROID)
#include <signal.h>
#include <sys/prctl.h>
@@ -33,6 +34,8 @@
#include "chromecast/net/connectivity_checker.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
+#include "media/audio/audio_manager.h"
+#include "media/audio/audio_manager_factory.h"
#include "media/base/browser_cdm_factory.h"
#include "media/base/media_switches.h"
@@ -192,11 +195,13 @@ void AddDefaultCommandLineSwitches(base::CommandLine* command_line) {
CastBrowserMainParts::CastBrowserMainParts(
const content::MainFunctionParams& parameters,
- URLRequestContextFactory* url_request_context_factory)
+ URLRequestContextFactory* url_request_context_factory,
+ scoped_ptr<::media::AudioManagerFactory> audio_manager_factory)
: BrowserMainParts(),
cast_browser_process_(new CastBrowserProcess()),
parameters_(parameters),
- url_request_context_factory_(url_request_context_factory) {
+ url_request_context_factory_(url_request_context_factory),
+ audio_manager_factory_(audio_manager_factory.Pass()) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
AddDefaultCommandLineSwitches(command_line);
}
@@ -212,6 +217,10 @@ 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());
« 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