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

Unified Diff: third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp

Issue 2186203002: [worklets] Add stub classes for window.animationWorklet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 5 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/compositorworker/AnimationWorklet.cpp
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp b/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..488257ca1875449dc02abf49e131a07faa6ff1d4
--- /dev/null
+++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorklet.cpp
@@ -0,0 +1,41 @@
+// 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/compositorworker/AnimationWorklet.h"
+
+#include "bindings/core/v8/V8Binding.h"
+#include "core/dom/ExecutionContext.h"
+#include "modules/worklet/ThreadedWorkletGlobalScopeProxy.h"
+
+namespace blink {
+
+// static
+AnimationWorklet* AnimationWorklet::create(ExecutionContext* executionContext)
+{
+ AnimationWorklet* worklet = new AnimationWorklet(executionContext);
+ worklet->suspendIfNeeded();
+ return worklet;
+}
+
+AnimationWorklet::AnimationWorklet(ExecutionContext* executionContext)
+ : Worklet(executionContext)
+ , m_workletGlobalScopeProxy(new ThreadedWorkletGlobalScopeProxy())
+{
+}
+
+AnimationWorklet::~AnimationWorklet()
+{
+}
+
+WorkletGlobalScopeProxy* AnimationWorklet::workletGlobalScopeProxy() const
+{
+ return m_workletGlobalScopeProxy.get();
+}
+
+DEFINE_TRACE(AnimationWorklet)
+{
+ Worklet::trace(visitor);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698