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

Side by Side 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: Created 5 years, 7 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/media/audio_manager_factory_simple.cc » ('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 #if !defined(OS_ANDROID) 7 #if !defined(OS_ANDROID)
8 #include <signal.h> 8 #include <signal.h>
9 #include <sys/prctl.h> 9 #include <sys/prctl.h>
10 #endif 10 #endif
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 NOTREACHED(); 133 NOTREACHED();
134 } else { 134 } else {
135 DCHECK_EQ(sa_old.sa_handler, KillOnAlarm); 135 DCHECK_EQ(sa_old.sa_handler, KillOnAlarm);
136 } 136 }
137 } 137 }
138 #endif // !defined(OS_ANDROID) 138 #endif // !defined(OS_ANDROID)
139 139
140 } // namespace 140 } // namespace
141 141
142 namespace chromecast { 142 namespace chromecast {
143
144 namespace media {
145 // Forward declaration of setter for audio manager factory. This method should
146 // call ::media::AudioManager::SetAudioManagerFactory to provide a platform
147 // implmentation of AudioManager.
148 void SetPlatformAudioManagerFactory();
gunsch 2015/04/30 15:50:38 This interface probably lives better somewhere lik
149 }
150
143 namespace shell { 151 namespace shell {
144 152
145 namespace { 153 namespace {
146 154
147 struct DefaultCommandLineSwitch { 155 struct DefaultCommandLineSwitch {
148 const char* const switch_name; 156 const char* const switch_name;
149 const char* const switch_value; 157 const char* const switch_value;
150 }; 158 };
151 159
152 DefaultCommandLineSwitch g_default_switches[] = { 160 DefaultCommandLineSwitch g_default_switches[] = {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 213 }
206 214
207 void CastBrowserMainParts::PreMainMessageLoopStart() { 215 void CastBrowserMainParts::PreMainMessageLoopStart() {
208 // GroupedHistograms needs to be initialized before any threads are created 216 // GroupedHistograms needs to be initialized before any threads are created
209 // to prevent race conditions between calls to Preregister and those threads 217 // to prevent race conditions between calls to Preregister and those threads
210 // attempting to collect metrics. 218 // attempting to collect metrics.
211 // This call must also be before NetworkChangeNotifier, as it generates 219 // This call must also be before NetworkChangeNotifier, as it generates
212 // Net/DNS metrics. 220 // Net/DNS metrics.
213 metrics::PreregisterAllGroupedHistograms(); 221 metrics::PreregisterAllGroupedHistograms();
214 222
223 // Set the platform's implementation of AudioManager factory.
224 ::chromecast::media::SetPlatformAudioManagerFactory();
225
215 #if defined(OS_ANDROID) 226 #if defined(OS_ANDROID)
216 net::NetworkChangeNotifier::SetFactory( 227 net::NetworkChangeNotifier::SetFactory(
217 new net::NetworkChangeNotifierFactoryAndroid()); 228 new net::NetworkChangeNotifierFactoryAndroid());
218 #endif // defined(OS_ANDROID) 229 #endif // defined(OS_ANDROID)
219 } 230 }
220 231
221 void CastBrowserMainParts::PostMainMessageLoopStart() { 232 void CastBrowserMainParts::PostMainMessageLoopStart() {
222 cast_browser_process_->SetMetricsHelper(make_scoped_ptr( 233 cast_browser_process_->SetMetricsHelper(make_scoped_ptr(
223 new metrics::CastMetricsHelper(base::MessageLoopProxy::current()))); 234 new metrics::CastMetricsHelper(base::MessageLoopProxy::current())));
224 235
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 #else 356 #else
346 cast_browser_process_->cast_service()->Finalize(); 357 cast_browser_process_->cast_service()->Finalize();
347 cast_browser_process_->metrics_service_client()->Finalize(); 358 cast_browser_process_->metrics_service_client()->Finalize();
348 cast_browser_process_.reset(); 359 cast_browser_process_.reset();
349 DeregisterKillOnAlarm(); 360 DeregisterKillOnAlarm();
350 #endif 361 #endif
351 } 362 }
352 363
353 } // namespace shell 364 } // namespace shell
354 } // namespace chromecast 365 } // namespace chromecast
OLDNEW
« no previous file with comments | « no previous file | chromecast/browser/media/audio_manager_factory_simple.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698