Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PaintWorkletGlobalScopeProxy_h | |
| 6 #define PaintWorkletGlobalScopeProxy_h | |
| 7 | |
| 8 #include "core/workers/WorkletGlobalScopeProxy.h" | |
| 9 | |
| 10 #include "modules/ModulesExport.h" | |
| 11 #include "modules/csspaint/PaintWorkletGlobalScope.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 class CSSPaintDefinition; | |
| 16 class LocalFrame; | |
| 17 | |
|
falken
2017/05/01 06:02:38
// A proxy for Worklet to talk to PaintWorkletGlob
nhiroki
2017/05/01 07:30:33
Done.
| |
| 18 class MODULES_EXPORT PaintWorkletGlobalScopeProxy | |
| 19 : public WorkletGlobalScopeProxy { | |
| 20 public: | |
| 21 static std::unique_ptr<PaintWorkletGlobalScopeProxy> Create(LocalFrame*); | |
| 22 static PaintWorkletGlobalScopeProxy* From(WorkletGlobalScopeProxy*); | |
| 23 | |
| 24 virtual ~PaintWorkletGlobalScopeProxy() = default; | |
| 25 | |
| 26 // Implements WorkletGlobalScopeProxy. | |
| 27 void FetchAndInvokeScript(const KURL& module_url_record, | |
| 28 WorkletPendingTasks*) override; | |
| 29 void EvaluateScript(const ScriptSourceCode&) override; | |
| 30 void TerminateWorkletGlobalScope() override; | |
| 31 | |
| 32 CSSPaintDefinition* FindDefinition(const String& name); | |
| 33 void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*); | |
| 34 | |
| 35 PaintWorkletGlobalScope* global_scope() const { return global_scope_.Get(); } | |
| 36 | |
| 37 private: | |
| 38 explicit PaintWorkletGlobalScopeProxy(LocalFrame*); | |
| 39 | |
| 40 Persistent<PaintWorkletGlobalScope> global_scope_; | |
| 41 }; | |
| 42 | |
| 43 } // namespace blink | |
| 44 | |
| 45 #endif // PaintWorkletGlobalScopeProxy_h | |
| OLD | NEW |