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

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

Issue 1911913002: Convert //media/audio from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix cast + windows build Created 4 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 unified diff | Download patch
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 // AudioOutputDispatcherImpl is an implementation of AudioOutputDispatcher. 5 // AudioOutputDispatcherImpl is an implementation of AudioOutputDispatcher.
6 // 6 //
7 // To avoid opening and closing audio devices more frequently than necessary, 7 // To avoid opening and closing audio devices more frequently than necessary,
8 // each dispatcher has a pool of inactive physical streams. A stream is closed 8 // each dispatcher has a pool of inactive physical streams. A stream is closed
9 // only if it hasn't been used for a certain period of time (specified via the 9 // only if it hasn't been used for a certain period of time (specified via the
10 // constructor). 10 // constructor).
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 std::vector<AudioOutputStream*> idle_streams_; 84 std::vector<AudioOutputStream*> idle_streams_;
85 85
86 // When streams are stopped they're added to |idle_streams_|, if no stream is 86 // When streams are stopped they're added to |idle_streams_|, if no stream is
87 // reused before |close_delay_| elapses |close_timer_| will run 87 // reused before |close_delay_| elapses |close_timer_| will run
88 // CloseIdleStreams(). 88 // CloseIdleStreams().
89 base::DelayTimer close_timer_; 89 base::DelayTimer close_timer_;
90 90
91 typedef std::map<AudioOutputProxy*, AudioOutputStream*> AudioStreamMap; 91 typedef std::map<AudioOutputProxy*, AudioOutputStream*> AudioStreamMap;
92 AudioStreamMap proxy_to_physical_map_; 92 AudioStreamMap proxy_to_physical_map_;
93 93
94 scoped_ptr<AudioLog> audio_log_; 94 std::unique_ptr<AudioLog> audio_log_;
danakj 2016/04/22 22:47:36 include memory
dcheng 2016/04/22 23:13:20 Done.
95 typedef std::map<AudioOutputStream*, int> AudioStreamIDMap; 95 typedef std::map<AudioOutputStream*, int> AudioStreamIDMap;
96 AudioStreamIDMap audio_stream_ids_; 96 AudioStreamIDMap audio_stream_ids_;
97 int audio_stream_id_; 97 int audio_stream_id_;
98 98
99 DISALLOW_COPY_AND_ASSIGN(AudioOutputDispatcherImpl); 99 DISALLOW_COPY_AND_ASSIGN(AudioOutputDispatcherImpl);
100 }; 100 };
101 101
102 } // namespace media 102 } // namespace media
103 103
104 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_ 104 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DISPATCHER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698