Chromium Code Reviews| 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..75135a53a0eada83d13c5b1f6ca258fc1c55e217 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h |
| @@ -0,0 +1,46 @@ |
| +// 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 std::unique_ptr<PaintWorkletGlobalScopeProxy> Create(LocalFrame*); |
| + static PaintWorkletGlobalScopeProxy* From(WorkletGlobalScopeProxy*); |
| + |
| + 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: |
| + explicit PaintWorkletGlobalScopeProxy(LocalFrame*); |
| + |
| + Persistent<PaintWorkletGlobalScope> global_scope_; |
|
haraken
2017/05/01 08:43:47
Are you pretty sure that this persistent handle do
nhiroki
2017/05/02 04:45:24
Hmmm... I'm not 100% sure that this never cause th
haraken
2017/05/02 04:49:43
Sounds good.
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // PaintWorkletGlobalScopeProxy_h |