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

Side by Side Diff: media/blink/webaudiosourceprovider_impl.h

Issue 1904253002: Convert //media/blink from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ 5 #ifndef MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_
6 #define MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ 6 #define MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 25 matching lines...) Expand all
36 // In either case, the internal RenderCallback allows for delivering a copy of 36 // In either case, the internal RenderCallback allows for delivering a copy of
37 // the data if a listener is configured. WASPImpl is also a 37 // the data if a listener is configured. WASPImpl is also a
38 // RestartableAudioRendererSink itself in order to be controlled (Play(), 38 // RestartableAudioRendererSink itself in order to be controlled (Play(),
39 // Pause() etc). 39 // Pause() etc).
40 // 40 //
41 // All calls are protected by a lock. 41 // All calls are protected by a lock.
42 class MEDIA_BLINK_EXPORT WebAudioSourceProviderImpl 42 class MEDIA_BLINK_EXPORT WebAudioSourceProviderImpl
43 : NON_EXPORTED_BASE(public blink::WebAudioSourceProvider), 43 : NON_EXPORTED_BASE(public blink::WebAudioSourceProvider),
44 NON_EXPORTED_BASE(public SwitchableAudioRendererSink) { 44 NON_EXPORTED_BASE(public SwitchableAudioRendererSink) {
45 public: 45 public:
46 using CopyAudioCB = base::Callback< 46 using CopyAudioCB = base::Callback<void(std::unique_ptr<AudioBus>,
47 void(scoped_ptr<AudioBus>, uint32_t delay_milliseconds, int sample_rate)>; 47 uint32_t delay_milliseconds,
48 int sample_rate)>;
48 49
49 explicit WebAudioSourceProviderImpl( 50 explicit WebAudioSourceProviderImpl(
50 const scoped_refptr<SwitchableAudioRendererSink>& sink); 51 const scoped_refptr<SwitchableAudioRendererSink>& sink);
51 52
52 // blink::WebAudioSourceProvider implementation. 53 // blink::WebAudioSourceProvider implementation.
53 void setClient(blink::WebAudioSourceProviderClient* client) override; 54 void setClient(blink::WebAudioSourceProviderClient* client) override;
54 void provideInput(const blink::WebVector<float*>& audio_data, 55 void provideInput(const blink::WebVector<float*>& audio_data,
55 size_t number_of_frames) override; 56 size_t number_of_frames) override;
56 57
57 // RestartableAudioRendererSink implementation. 58 // RestartableAudioRendererSink implementation.
(...skipping 30 matching lines...) Expand all
88 PlaybackState state_; 89 PlaybackState state_;
89 90
90 // Closure that calls OnSetFormat() on |client_| on the renderer thread. 91 // Closure that calls OnSetFormat() on |client_| on the renderer thread.
91 base::Closure set_format_cb_; 92 base::Closure set_format_cb_;
92 // When set via setClient() it overrides |sink_| for consuming audio. 93 // When set via setClient() it overrides |sink_| for consuming audio.
93 blink::WebAudioSourceProviderClient* client_; 94 blink::WebAudioSourceProviderClient* client_;
94 95
95 // Where audio ends up unless overridden by |client_|. 96 // Where audio ends up unless overridden by |client_|.
96 base::Lock sink_lock_; 97 base::Lock sink_lock_;
97 const scoped_refptr<SwitchableAudioRendererSink> sink_; 98 const scoped_refptr<SwitchableAudioRendererSink> sink_;
98 scoped_ptr<AudioBus> bus_wrapper_; 99 std::unique_ptr<AudioBus> bus_wrapper_;
99 100
100 // An inner class acting as a T filter where actual data can be tapped. 101 // An inner class acting as a T filter where actual data can be tapped.
101 class TeeFilter; 102 class TeeFilter;
102 scoped_ptr<TeeFilter> tee_filter_; 103 std::unique_ptr<TeeFilter> tee_filter_;
103 104
104 // NOTE: Weak pointers must be invalidated before all other member variables. 105 // NOTE: Weak pointers must be invalidated before all other member variables.
105 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_; 106 base::WeakPtrFactory<WebAudioSourceProviderImpl> weak_factory_;
106 107
107 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl); 108 DISALLOW_IMPLICIT_CONSTRUCTORS(WebAudioSourceProviderImpl);
108 }; 109 };
109 110
110 } // namespace media 111 } // namespace media
111 112
112 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_ 113 #endif // MEDIA_BLINK_WEBAUDIOSOURCEPROVIDER_IMPL_H_
OLDNEW
« no previous file with comments | « media/blink/video_frame_compositor_unittest.cc ('k') | media/blink/webaudiosourceprovider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698