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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp

Issue 2727733002: Implement AudioWorkletProcessor interface (Closed)
Patch Set: Addressing feedback from rtoy@ 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ad498ae5fd351585eb8f57b6b0d957e5328421f3
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp
@@ -0,0 +1,42 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "modules/webaudio/AudioWorkletProcessorDefinition.h"
+
+namespace blink {
+
+AudioWorkletProcessorDefinition* AudioWorkletProcessorDefinition::create(
+ v8::Isolate* isolate,
+ const String& name,
+ v8::Local<v8::Function> constructor,
+ v8::Local<v8::Function> process) {
+ DCHECK(!isMainThread());
+ return new AudioWorkletProcessorDefinition(isolate, name, constructor,
+ process);
+}
+
+AudioWorkletProcessorDefinition::AudioWorkletProcessorDefinition(
+ v8::Isolate* isolate,
+ const String& name,
+ v8::Local<v8::Function> constructor,
+ v8::Local<v8::Function> process)
+ : m_name(name),
+ m_constructor(isolate, constructor),
+ m_process(isolate, process) {}
+
+AudioWorkletProcessorDefinition::~AudioWorkletProcessorDefinition() {}
+
+v8::Local<v8::Function> AudioWorkletProcessorDefinition::constructorLocal(
+ v8::Isolate* isolate) {
+ DCHECK(!isMainThread());
+ return m_constructor.newLocal(isolate);
+}
+
+v8::Local<v8::Function> AudioWorkletProcessorDefinition::processLocal(
+ v8::Isolate* isolate) {
+ DCHECK(!isMainThread());
+ return m_process.newLocal(isolate);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698