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

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

Issue 16207005: Fix remaining uses of WeakPtr<T>'s operator T* conversion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « gpu/command_buffer/service/context_group.cc ('k') | net/quic/quic_stream_factory.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 (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_output_dispatcher_impl.h" 5 #include "media/audio/audio_output_dispatcher_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 11 matching lines...) Expand all
22 const std::string& input_device_id, 22 const std::string& input_device_id,
23 const base::TimeDelta& close_delay) 23 const base::TimeDelta& close_delay)
24 : AudioOutputDispatcher(audio_manager, params, input_device_id), 24 : AudioOutputDispatcher(audio_manager, params, input_device_id),
25 pause_delay_(base::TimeDelta::FromMicroseconds( 25 pause_delay_(base::TimeDelta::FromMicroseconds(
26 2 * params.frames_per_buffer() * base::Time::kMicrosecondsPerSecond / 26 2 * params.frames_per_buffer() * base::Time::kMicrosecondsPerSecond /
27 static_cast<float>(params.sample_rate()))), 27 static_cast<float>(params.sample_rate()))),
28 paused_proxies_(0), 28 paused_proxies_(0),
29 weak_this_(this), 29 weak_this_(this),
30 close_timer_(FROM_HERE, 30 close_timer_(FROM_HERE,
31 close_delay, 31 close_delay,
32 weak_this_.GetWeakPtr(), 32 this,
33 &AudioOutputDispatcherImpl::ClosePendingStreams) { 33 &AudioOutputDispatcherImpl::ClosePendingStreams) {
34 } 34 }
35 35
36 AudioOutputDispatcherImpl::~AudioOutputDispatcherImpl() { 36 AudioOutputDispatcherImpl::~AudioOutputDispatcherImpl() {
37 DCHECK(proxy_to_physical_map_.empty()); 37 DCHECK(proxy_to_physical_map_.empty());
38 DCHECK(idle_streams_.empty()); 38 DCHECK(idle_streams_.empty());
39 DCHECK(pausing_streams_.empty()); 39 DCHECK(pausing_streams_.empty());
40 } 40 }
41 41
42 bool AudioOutputDispatcherImpl::OpenStream() { 42 bool AudioOutputDispatcherImpl::OpenStream() {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // This method is called by |close_timer_|. 195 // This method is called by |close_timer_|.
196 void AudioOutputDispatcherImpl::ClosePendingStreams() { 196 void AudioOutputDispatcherImpl::ClosePendingStreams() {
197 DCHECK_EQ(base::MessageLoop::current(), message_loop_); 197 DCHECK_EQ(base::MessageLoop::current(), message_loop_);
198 while (!idle_streams_.empty()) { 198 while (!idle_streams_.empty()) {
199 idle_streams_.back()->Close(); 199 idle_streams_.back()->Close();
200 idle_streams_.pop_back(); 200 idle_streams_.pop_back();
201 } 201 }
202 } 202 }
203 203
204 } // namespace media 204 } // namespace media
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698