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

Side by Side Diff: media/audio/audio_manager_base.cc

Issue 189123003: Remove deprecated media switches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | media/base/media_switches.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/audio/audio_manager_base.h" 5 #include "media/audio/audio_manager_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), 82 ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY),
83 audio_thread_("AudioThread"), 83 audio_thread_("AudioThread"),
84 audio_log_factory_(audio_log_factory) { 84 audio_log_factory_(audio_log_factory) {
85 #if defined(OS_WIN) 85 #if defined(OS_WIN)
86 audio_thread_.init_com_with_mta(true); 86 audio_thread_.init_com_with_mta(true);
87 #elif defined(OS_MACOSX) 87 #elif defined(OS_MACOSX)
88 // CoreAudio calls must occur on the main thread of the process, which in our 88 // CoreAudio calls must occur on the main thread of the process, which in our
89 // case is sadly the browser UI thread. Failure to execute calls on the right 89 // case is sadly the browser UI thread. Failure to execute calls on the right
90 // thread leads to crashes and odd behavior. See http://crbug.com/158170. 90 // thread leads to crashes and odd behavior. See http://crbug.com/158170.
91 // TODO(dalecurtis): We should require the message loop to be passed in. 91 // TODO(dalecurtis): We should require the message loop to be passed in.
92 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 92 if (base::MessageLoopForUI::IsCurrent()) {
93 if (!cmd_line->HasSwitch(switches::kDisableMainThreadAudio) &&
94 base::MessageLoopProxy::current().get() &&
95 base::MessageLoopForUI::IsCurrent()) {
96 task_runner_ = base::MessageLoopProxy::current(); 93 task_runner_ = base::MessageLoopProxy::current();
97 return; 94 return;
98 } 95 }
99 #endif 96 #endif
100 97
101 CHECK(audio_thread_.Start()); 98 CHECK(audio_thread_.Start());
102 task_runner_ = audio_thread_.message_loop_proxy(); 99 task_runner_ = audio_thread_.message_loop_proxy();
103 } 100 }
104 101
105 AudioManagerBase::~AudioManagerBase() { 102 AudioManagerBase::~AudioManagerBase() {
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 (*it)->dispatcher->CloseStreamsForWedgeFix(); 434 (*it)->dispatcher->CloseStreamsForWedgeFix();
438 } 435 }
439 for (AudioOutputDispatchers::iterator it = output_dispatchers_.begin(); 436 for (AudioOutputDispatchers::iterator it = output_dispatchers_.begin();
440 it != output_dispatchers_.end(); ++it) { 437 it != output_dispatchers_.end(); ++it) {
441 (*it)->dispatcher->RestartStreamsForWedgeFix(); 438 (*it)->dispatcher->RestartStreamsForWedgeFix();
442 } 439 }
443 #endif 440 #endif
444 } 441 }
445 442
446 } // namespace media 443 } // namespace media
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | media/base/media_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698