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

Unified Diff: third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp

Issue 1818223002: Introduce PaintWorkletGlobalScope, rename renderWorklet attribute to paintWorklet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix interface listing order. Created 4 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/csspaint/PaintWorklet.cpp
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c184100effc65a9046c063ab50ec68fc93b78521
--- /dev/null
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp
@@ -0,0 +1,37 @@
+// 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/csspaint/PaintWorklet.h"
+
+#include "bindings/core/v8/V8Binding.h"
+#include "core/dom/ExecutionContext.h"
+#include "modules/csspaint/PaintWorkletGlobalScope.h"
+
+namespace blink {
+
+// static
+PaintWorklet* PaintWorklet::create(LocalFrame* frame, ExecutionContext* executionContext)
+{
+ PaintWorklet* worklet = new PaintWorklet(frame, executionContext);
+ worklet->suspendIfNeeded();
+ return worklet;
+}
+
+PaintWorklet::PaintWorklet(LocalFrame* frame, ExecutionContext* executionContext)
+ : Worklet(executionContext)
+ , m_paintWorkletGlobalScope(PaintWorkletGlobalScope::create(frame, executionContext->url(), executionContext->userAgent(), executionContext->getSecurityOrigin(), toIsolate(executionContext)))
+{
+}
+
+PaintWorklet::~PaintWorklet()
+{
+}
+
+DEFINE_TRACE(PaintWorklet)
+{
+ visitor->trace(m_paintWorkletGlobalScope);
+ Worklet::trace(visitor);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698