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

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

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Set svn eol properties for a couple of files Created 9 years 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 | « media/audio/audio_output_proxy.h ('k') | media/audio/audio_output_proxy_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_output_proxy.h" 5 #include "media/audio/audio_output_proxy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 #include "media/audio/audio_manager.h" 10 #include "media/audio/audio_manager.h"
11 #include "media/audio/audio_output_dispatcher.h" 11 #include "media/audio/audio_output_dispatcher.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 void AudioOutputProxy::GetVolume(double* volume) { 77 void AudioOutputProxy::GetVolume(double* volume) {
78 DCHECK_EQ(MessageLoop::current(), dispatcher_->message_loop()); 78 DCHECK_EQ(MessageLoop::current(), dispatcher_->message_loop());
79 *volume = volume_; 79 *volume = volume_;
80 } 80 }
81 81
82 void AudioOutputProxy::Close() { 82 void AudioOutputProxy::Close() {
83 DCHECK_EQ(MessageLoop::current(), dispatcher_->message_loop()); 83 DCHECK_EQ(MessageLoop::current(), dispatcher_->message_loop());
84 DCHECK(state_ == kCreated || state_ == kError || state_ == kOpened); 84 DCHECK(state_ == kCreated || state_ == kError || state_ == kOpened);
85 DCHECK(!physical_stream_); 85 DCHECK(!physical_stream_);
86 86
87 if (state_ != kCreated) { 87 if (state_ != kCreated)
88 dispatcher_->StreamClosed(); 88 dispatcher_->StreamClosed();
89 } 89
90 dispatcher_->message_loop()->DeleteSoon(FROM_HERE, this);
91 state_ = kClosed; 90 state_ = kClosed;
91
92 // Delete the object now like is done in the Close() implementation of
93 // physical stream objects. If we delete the object via DeleteSoon, we
94 // unnecessarily complicate the Shutdown procedure of the
95 // dispatcher+audio manager.
96 delete this;
92 } 97 }
OLDNEW
« no previous file with comments | « media/audio/audio_output_proxy.h ('k') | media/audio/audio_output_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698