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

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

Issue 2727733002: Implement AudioWorkletProcessor interface (Closed)
Patch Set: Added AudioWorkletGlobalScopeTest.cpp Created 3 years, 9 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef AudioWorkletProcessor_h
6 #define AudioWorkletProcessor_h
7
8 #include "bindings/core/v8/ScopedPersistent.h"
9 #include "modules/ModulesExport.h"
10 #include "modules/webaudio/AudioWorkletGlobalScope.h"
11 #include "platform/heap/Handle.h"
12 #include "v8/include/v8.h"
13 #include "wtf/text/WTFString.h"
14
15 namespace blink {
16
17 class AudioBuffer;
18 class AudioWorkletGlobalScope;
nhiroki 2017/03/16 00:21:36 We already included AWGS.h
hongchan 2017/03/16 22:11:29 I removed the header from the inclusion.
19 class AudioWorkletProcessorDefinition;
20
21 // AudioWorkletProcessor class represents the active instance created from
22 // AudioWorkletProcessorDefinition. |AudioWorkletNodeHandler| invokes
23 // process() method in this object upon graph rendering.
24 //
25 // This is constructed and destroyed on a worker thread, and all methods also
26 // must be called on the worker thread.
27 class MODULES_EXPORT AudioWorkletProcessor
28 : public GarbageCollectedFinalized<AudioWorkletProcessor> {
29 public:
30 static AudioWorkletProcessor* create(AudioWorkletGlobalScope*,
31 const String& name);
32 virtual ~AudioWorkletProcessor();
33
34 void setInstance(v8::Isolate*, v8::Local<v8::Object> instance);
35
36 v8::Local<v8::Object> instanceLocal(v8::Isolate*);
37
38 // |AudioWorkletHandler| invokes this method to process audio.
39 void process(AudioBuffer* inputBuffer, AudioBuffer* outputBuffer);
40
41 const String& name() const { return m_name; }
42
43 DECLARE_TRACE();
44
45 private:
46 AudioWorkletProcessor(AudioWorkletGlobalScope*, const String& name);
47
48 Member<AudioWorkletGlobalScope> m_globalScope;
49 String m_name;
nhiroki 2017/03/16 00:21:36 const?
hongchan 2017/03/16 22:11:29 Done.
50 ScopedPersistent<v8::Object> m_instance;
51 };
52
53 } // namespace blink
54
55 #endif // AudioWorkletProcessor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698