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

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

Issue 1960533003: [DO NOT SUBMIT] AudioWorklet FS1: importing scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 2016 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 AudioWorkletProcessorDefinition_h
6 #define AudioWorkletProcessorDefinition_h
7
8 #include "bindings/core/v8/ScopedPersistent.h"
9 #include "platform/heap/Handle.h"
10 #include <v8.h>
11
12 namespace blink {
13
14 class ScriptState;
15
16 class AudioWorkletProcessorDefinition final : public GarbageCollectedFinalized<A udioWorkletProcessorDefinition> {
17 public:
18 static AudioWorkletProcessorDefinition* create(ScriptState*, v8::Local<v8::F unction> constructor, v8::Local<v8::Function> process);
19 virtual ~AudioWorkletProcessorDefinition();
20
21 // TODO: connect this to WebAudio render callback.
22 void process();
23
24 ScriptState* getScriptState() const { return m_scriptState.get(); }
25
26 v8::Local<v8::Function> processFunctionForTesting(v8::Isolate* isolate) { re turn m_process.newLocal(isolate); }
27
28 DEFINE_INLINE_TRACE() {};
29
30 private:
31 AudioWorkletProcessorDefinition(ScriptState*, v8::Local<v8::Function> constr uctor, v8::Local<v8::Function> process);
32
33 void maybeCreateProcessInstance();
34
35 RefPtr<ScriptState> m_scriptState;
36
37 // This object keeps the class instance object, constructor function and
38 // process function alive. This object needs to be destroyed to break a
39 // reference cycle between it and the AudioWorkletGlobalScope.
40 ScopedPersistent<v8::Function> m_constructor;
41 ScopedPersistent<v8::Function> m_process;
42
43 bool m_didCallConstructor;
44 };
45
46 } // namespace blink
47
48 #endif // AudioWorkletProcessorDefinition_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698