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

Unified Diff: third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h

Issue 2853743002: Worklet: Introduce PaintWorkletGlobalScopeProxy (Closed)
Patch Set: address review comments Created 3 years, 8 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/PaintWorkletGlobalScopeProxy.h
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..3aa0807578b401801b37942fb535a23a5a719449
--- /dev/null
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h
@@ -0,0 +1,44 @@
+// 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.
+
+#ifndef PaintWorkletGlobalScopeProxy_h
+#define PaintWorkletGlobalScopeProxy_h
+
+#include "core/workers/WorkletGlobalScopeProxy.h"
+
+#include "modules/ModulesExport.h"
+#include "modules/csspaint/PaintWorkletGlobalScope.h"
+
+namespace blink {
+
+class CSSPaintDefinition;
+class LocalFrame;
+
+// A proxy for PaintWorklet to talk to PaintWorkletGlobalScope.
+class MODULES_EXPORT PaintWorkletGlobalScopeProxy
+ : public WorkletGlobalScopeProxy {
+ public:
+ static PaintWorkletGlobalScopeProxy* From(WorkletGlobalScopeProxy*);
+
+ explicit PaintWorkletGlobalScopeProxy(LocalFrame*);
+ virtual ~PaintWorkletGlobalScopeProxy() = default;
+
+ // Implements WorkletGlobalScopeProxy.
+ void FetchAndInvokeScript(const KURL& module_url_record,
+ WorkletPendingTasks*) override;
+ void EvaluateScript(const ScriptSourceCode&) override;
+ void TerminateWorkletGlobalScope() override;
+
+ CSSPaintDefinition* FindDefinition(const String& name);
+ void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*);
+
+ PaintWorkletGlobalScope* global_scope() const { return global_scope_.Get(); }
+
+ private:
+ Persistent<PaintWorkletGlobalScope> global_scope_;
+};
+
+} // namespace blink
+
+#endif // PaintWorkletGlobalScopeProxy_h

Powered by Google App Engine
This is Rietveld 408576698