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

Side by Side Diff: third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScopeProxy.h

Issue 2853743002: Worklet: Introduce PaintWorkletGlobalScopeProxy (Closed)
Patch Set: address review comments Created 3 years, 7 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 unified diff | Download patch
OLDNEW
(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
18 // A proxy for PaintWorklet to talk to PaintWorkletGlobalScope.
19 class MODULES_EXPORT PaintWorkletGlobalScopeProxy
20 : public WorkletGlobalScopeProxy {
21 public:
22 static std::unique_ptr<PaintWorkletGlobalScopeProxy> Create(LocalFrame*);
23 static PaintWorkletGlobalScopeProxy* From(WorkletGlobalScopeProxy*);
24
25 virtual ~PaintWorkletGlobalScopeProxy() = default;
26
27 // Implements WorkletGlobalScopeProxy.
28 void FetchAndInvokeScript(const KURL& module_url_record,
29 WorkletPendingTasks*) override;
30 void EvaluateScript(const ScriptSourceCode&) override;
31 void TerminateWorkletGlobalScope() override;
32
33 CSSPaintDefinition* FindDefinition(const String& name);
34 void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*);
35
36 PaintWorkletGlobalScope* global_scope() const { return global_scope_.Get(); }
37
38 private:
39 explicit PaintWorkletGlobalScopeProxy(LocalFrame*);
40
41 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.
42 };
43
44 } // namespace blink
45
46 #endif // PaintWorkletGlobalScopeProxy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698