OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. All rights reserved. | 2 * Copyright 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 15 matching lines...) Expand all Loading... |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef MediaStreamWebAudioSource_h | 31 #ifndef MediaStreamWebAudioSource_h |
32 #define MediaStreamWebAudioSource_h | 32 #define MediaStreamWebAudioSource_h |
33 | 33 |
34 #include "platform/audio/AudioSourceProvider.h" | 34 #include "platform/audio/AudioSourceProvider.h" |
35 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
36 #include "wtf/OwnPtr.h" | 36 #include "wtf/PtrUtil.h" |
37 #include "wtf/PassOwnPtr.h" | |
38 #include "wtf/ThreadingPrimitives.h" | 37 #include "wtf/ThreadingPrimitives.h" |
39 #include "wtf/build_config.h" | 38 #include "wtf/build_config.h" |
| 39 #include <memory> |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class WebAudioSourceProvider; | 43 class WebAudioSourceProvider; |
44 | 44 |
45 class MediaStreamWebAudioSource : public AudioSourceProvider { | 45 class MediaStreamWebAudioSource : public AudioSourceProvider { |
46 WTF_MAKE_NONCOPYABLE(MediaStreamWebAudioSource); | 46 WTF_MAKE_NONCOPYABLE(MediaStreamWebAudioSource); |
47 public: | 47 public: |
48 static PassOwnPtr<MediaStreamWebAudioSource> create(PassOwnPtr<WebAudioSourc
eProvider> provider) { return adoptPtr(new MediaStreamWebAudioSource(std::move(p
rovider))); } | 48 static std::unique_ptr<MediaStreamWebAudioSource> create(std::unique_ptr<Web
AudioSourceProvider> provider) { return wrapUnique(new MediaStreamWebAudioSource
(std::move(provider))); } |
49 | 49 |
50 ~MediaStreamWebAudioSource() override; | 50 ~MediaStreamWebAudioSource() override; |
51 | 51 |
52 private: | 52 private: |
53 explicit MediaStreamWebAudioSource(PassOwnPtr<WebAudioSourceProvider>); | 53 explicit MediaStreamWebAudioSource(std::unique_ptr<WebAudioSourceProvider>); |
54 | 54 |
55 // blink::AudioSourceProvider implementation. | 55 // blink::AudioSourceProvider implementation. |
56 void provideInput(AudioBus*, size_t framesToProcess) override; | 56 void provideInput(AudioBus*, size_t framesToProcess) override; |
57 | 57 |
58 OwnPtr<WebAudioSourceProvider> m_webAudioSourceProvider; | 58 std::unique_ptr<WebAudioSourceProvider> m_webAudioSourceProvider; |
59 }; | 59 }; |
60 | 60 |
61 } // namespace blink | 61 } // namespace blink |
62 | 62 |
63 #endif // MediaStreamWebAudioSource_h | 63 #endif // MediaStreamWebAudioSource_h |
OLD | NEW |