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

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

Issue 2871513002: Worklet: Lazily create PaintWorkletGlobalScopes (Closed)
Patch Set: fix wrong dcheck Created 3 years, 6 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PaintWorkletGlobalScopeProxy_h 5 #ifndef PaintWorkletGlobalScopeProxy_h
6 #define PaintWorkletGlobalScopeProxy_h 6 #define PaintWorkletGlobalScopeProxy_h
7 7
8 #include "core/workers/WorkletGlobalScopeProxy.h" 8 #include "core/workers/WorkletGlobalScopeProxy.h"
9 9
10 #include "modules/ModulesExport.h" 10 #include "modules/ModulesExport.h"
11 #include "modules/csspaint/PaintWorkletGlobalScope.h" 11 #include "modules/csspaint/PaintWorkletGlobalScope.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class CSSPaintDefinition; 15 class CSSPaintDefinition;
16 class LocalFrame; 16 class LocalFrame;
17 17
18 // A proxy for PaintWorklet to talk to PaintWorkletGlobalScope. 18 // A proxy for PaintWorklet to talk to PaintWorkletGlobalScope.
19 class MODULES_EXPORT PaintWorkletGlobalScopeProxy 19 class MODULES_EXPORT PaintWorkletGlobalScopeProxy
20 : public WorkletGlobalScopeProxy { 20 : public WorkletGlobalScopeProxy {
21 public: 21 public:
22 static PaintWorkletGlobalScopeProxy* From(WorkletGlobalScopeProxy*); 22 static PaintWorkletGlobalScopeProxy* From(WorkletGlobalScopeProxy*);
23 23
24 explicit PaintWorkletGlobalScopeProxy(LocalFrame*); 24 PaintWorkletGlobalScopeProxy(LocalFrame*,
25 PaintWorkletPendingGeneratorRegistry*);
25 virtual ~PaintWorkletGlobalScopeProxy() = default; 26 virtual ~PaintWorkletGlobalScopeProxy() = default;
26 27
27 // Implements WorkletGlobalScopeProxy. 28 // Implements WorkletGlobalScopeProxy.
28 void FetchAndInvokeScript(const KURL& module_url_record, 29 void FetchAndInvokeScript(const KURL& module_url_record,
29 WebURLRequest::FetchCredentialsMode, 30 WebURLRequest::FetchCredentialsMode,
30 WorkletPendingTasks*) override; 31 WorkletPendingTasks*) override;
31 void EvaluateScript(const ScriptSourceCode&) override; 32 void EvaluateScript(const ScriptSourceCode&) override;
32 void TerminateWorkletGlobalScope() override; 33 void TerminateWorkletGlobalScope() override;
33 34
34 CSSPaintDefinition* FindDefinition(const String& name); 35 CSSPaintDefinition* FindDefinition(const String& name);
35 void AddPendingGenerator(const String& name, CSSPaintImageGeneratorImpl*);
36 36
37 PaintWorkletGlobalScope* global_scope() const { return global_scope_.Get(); } 37 PaintWorkletGlobalScope* global_scope() const { return global_scope_.Get(); }
38 38
39 private: 39 private:
40 Persistent<PaintWorkletGlobalScope> global_scope_; 40 Persistent<PaintWorkletGlobalScope> global_scope_;
41 }; 41 };
42 42
43 } // namespace blink 43 } // namespace blink
44 44
45 #endif // PaintWorkletGlobalScopeProxy_h 45 #endif // PaintWorkletGlobalScopeProxy_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698