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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioBasicProcessorHandler.h

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24 24
25 #ifndef AudioBasicProcessorHandler_h 25 #ifndef AudioBasicProcessorHandler_h
26 #define AudioBasicProcessorHandler_h 26 #define AudioBasicProcessorHandler_h
27 27
28 #include "modules/ModulesExport.h" 28 #include "modules/ModulesExport.h"
29 #include "modules/webaudio/AudioNode.h" 29 #include "modules/webaudio/AudioNode.h"
30 #include "wtf/Forward.h" 30 #include "wtf/Forward.h"
31 #include <memory>
31 32
32 namespace blink { 33 namespace blink {
33 34
34 class AudioNodeInput; 35 class AudioNodeInput;
35 class AudioProcessor; 36 class AudioProcessor;
36 37
37 // AudioBasicProcessorHandler is an AudioHandler with one input and one output 38 // AudioBasicProcessorHandler is an AudioHandler with one input and one output
38 // where the input and output have the same number of channels. 39 // where the input and output have the same number of channels.
39 class MODULES_EXPORT AudioBasicProcessorHandler : public AudioHandler { 40 class MODULES_EXPORT AudioBasicProcessorHandler : public AudioHandler {
40 public: 41 public:
41 static PassRefPtr<AudioBasicProcessorHandler> create(NodeType, AudioNode&, f loat sampleRate, PassOwnPtr<AudioProcessor>); 42 static PassRefPtr<AudioBasicProcessorHandler> create(NodeType, AudioNode&, f loat sampleRate, std::unique_ptr<AudioProcessor>);
42 ~AudioBasicProcessorHandler() override; 43 ~AudioBasicProcessorHandler() override;
43 44
44 // AudioHandler 45 // AudioHandler
45 void process(size_t framesToProcess) final; 46 void process(size_t framesToProcess) final;
46 void pullInputs(size_t framesToProcess) final; 47 void pullInputs(size_t framesToProcess) final;
47 void initialize() final; 48 void initialize() final;
48 void uninitialize() final; 49 void uninitialize() final;
49 50
50 // Called in the main thread when the number of channels for the input may h ave changed. 51 // Called in the main thread when the number of channels for the input may h ave changed.
51 void checkNumberOfChannelsForInput(AudioNodeInput*) final; 52 void checkNumberOfChannelsForInput(AudioNodeInput*) final;
52 53
53 // Returns the number of channels for both the input and the output. 54 // Returns the number of channels for both the input and the output.
54 unsigned numberOfChannels(); 55 unsigned numberOfChannels();
55 AudioProcessor* processor() { return m_processor.get(); } 56 AudioProcessor* processor() { return m_processor.get(); }
56 57
57 private: 58 private:
58 AudioBasicProcessorHandler(NodeType, AudioNode&, float sampleRate, PassOwnPt r<AudioProcessor>); 59 AudioBasicProcessorHandler(NodeType, AudioNode&, float sampleRate, std::uniq ue_ptr<AudioProcessor>);
59 double tailTime() const final; 60 double tailTime() const final;
60 double latencyTime() const final; 61 double latencyTime() const final;
61 62
62 OwnPtr<AudioProcessor> m_processor; 63 std::unique_ptr<AudioProcessor> m_processor;
63 }; 64 };
64 65
65 } // namespace blink 66 } // namespace blink
66 67
67 #endif // AudioBasicProcessorHandler_h 68 #endif // AudioBasicProcessorHandler_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698