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

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

Issue 1839913002: Implement PaintWorkletGlobalScope#registerPaint() for the CSS Paint API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + remove WillBe types. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 PaintWorkletGlobalScope_h 5 #ifndef PaintWorkletGlobalScope_h
6 #define PaintWorkletGlobalScope_h 6 #define PaintWorkletGlobalScope_h
7 7
8 #include "bindings/core/v8/ScriptValue.h" 8 #include "bindings/core/v8/ScriptValue.h"
9 #include "core/dom/ExecutionContext.h" 9 #include "core/dom/ExecutionContext.h"
10 #include "modules/ModulesExport.h"
10 #include "modules/worklet/WorkletGlobalScope.h" 11 #include "modules/worklet/WorkletGlobalScope.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 class PaintWorkletGlobalScope : public WorkletGlobalScope { 15 class CSSPaintDefinition;
16 class ExceptionState;
17
18 class MODULES_EXPORT PaintWorkletGlobalScope : public WorkletGlobalScope {
15 DEFINE_WRAPPERTYPEINFO(); 19 DEFINE_WRAPPERTYPEINFO();
16 public: 20 public:
17 static RawPtr<PaintWorkletGlobalScope> create(LocalFrame*, const KURL&, cons t String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*); 21 static RawPtr<PaintWorkletGlobalScope> create(LocalFrame*, const KURL&, cons t String& userAgent, PassRefPtr<SecurityOrigin>, v8::Isolate*);
18 ~PaintWorkletGlobalScope() override; 22 ~PaintWorkletGlobalScope() override;
23 void dispose() override;
19 24
20 bool isPaintWorkletGlobalScope() const final { return true; } 25 bool isPaintWorkletGlobalScope() const final { return true; }
21 void registerPaint(const String&, ScriptValue) { } 26 void registerPaint(const String& name, const ScriptValue& ctor, ExceptionSta te&);
27
28 CSSPaintDefinition* findDefinition(const String& name);
29
30 DECLARE_VIRTUAL_TRACE();
22 31
23 private: 32 private:
24 PaintWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, P assRefPtr<SecurityOrigin>, v8::Isolate*); 33 PaintWorkletGlobalScope(LocalFrame*, const KURL&, const String& userAgent, P assRefPtr<SecurityOrigin>, v8::Isolate*);
34
35 typedef HeapHashMap<String, Member<CSSPaintDefinition>> DefinitionMap;
36 DefinitionMap m_paintDefinitions;
25 }; 37 };
26 38
27 DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, ExecutionContext, context, context->i sPaintWorkletGlobalScope(), context.isPaintWorkletGlobalScope()); 39 DEFINE_TYPE_CASTS(PaintWorkletGlobalScope, ExecutionContext, context, context->i sPaintWorkletGlobalScope(), context.isPaintWorkletGlobalScope());
28 40
29 } // namespace blink 41 } // namespace blink
30 42
31 #endif // PaintWorkletGlobalScope_h 43 #endif // PaintWorkletGlobalScope_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698