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

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

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..620a8f855fbde63aab8a962717d528180fae1d27
--- /dev/null
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp
@@ -0,0 +1,47 @@
+// Copyright 2016 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/AudioWorklet.h"
+
+#include "bindings/core/v8/V8Binding.h"
+#include "core/dom/ExecutionContext.h"
+#include "modules/webaudio/AudioWorkletGlobalScope.h"
+
+namespace blink {
+
+// static
+AudioWorklet* AudioWorklet::create(LocalFrame* frame, ExecutionContext* executionContext)
+{
+ AudioWorklet* worklet = new AudioWorklet(frame, executionContext);
+ worklet->suspendIfNeeded();
+ return worklet;
+}
+
+AudioWorklet::AudioWorklet(LocalFrame* frame, ExecutionContext* executionContext)
+ : Worklet(executionContext)
+ , m_audioWorkletGlobalScope(AudioWorkletGlobalScope::create(frame, executionContext->url(), executionContext->userAgent(), executionContext->getSecurityOrigin(), toIsolate(executionContext)))
+{
+}
+
+AudioWorklet::~AudioWorklet()
+{
+}
+
+WorkletGlobalScope* AudioWorklet::workletGlobalScope() const
+{
+ return m_audioWorkletGlobalScope.get();
+}
+
+AudioWorkletProcessorDefinition* AudioWorklet::findDefinition(const String& name)
+{
+ return m_audioWorkletGlobalScope->findDefinition(name);
+}
+
+DEFINE_TRACE(AudioWorklet)
+{
+ visitor->trace(m_audioWorkletGlobalScope);
+ Worklet::trace(visitor);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698