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

Unified Diff: third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp

Issue 2853743002: Worklet: Introduce PaintWorkletGlobalScopeProxy (Closed)
Patch Set: address review comments Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp
index d4ba23475c976898a79d9812442c75c369609f3a..5631ede6909a80d6c746431a4abca10773172f2f 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorklet.cpp
@@ -18,30 +18,25 @@ PaintWorklet* PaintWorklet::Create(LocalFrame* frame) {
PaintWorklet::PaintWorklet(LocalFrame* frame)
: MainThreadWorklet(frame),
- paint_worklet_global_scope_(PaintWorkletGlobalScope::Create(
- frame,
- frame->GetDocument()->Url(),
- frame->GetDocument()->UserAgent(),
- frame->GetDocument()->GetSecurityOrigin(),
- ToIsolate(frame->GetDocument()))) {}
+ global_scope_proxy_(
+ WTF::MakeUnique<PaintWorkletGlobalScopeProxy>(frame)) {}
-PaintWorklet::~PaintWorklet() {}
+PaintWorklet::~PaintWorklet() = default;
-PaintWorkletGlobalScope* PaintWorklet::GetWorkletGlobalScopeProxy() const {
- return paint_worklet_global_scope_.Get();
+WorkletGlobalScopeProxy* PaintWorklet::GetWorkletGlobalScopeProxy() const {
+ return global_scope_proxy_.get();
}
CSSPaintDefinition* PaintWorklet::FindDefinition(const String& name) {
- return paint_worklet_global_scope_->FindDefinition(name);
+ return global_scope_proxy_->FindDefinition(name);
}
void PaintWorklet::AddPendingGenerator(const String& name,
CSSPaintImageGeneratorImpl* generator) {
- return paint_worklet_global_scope_->AddPendingGenerator(name, generator);
+ return global_scope_proxy_->AddPendingGenerator(name, generator);
}
DEFINE_TRACE(PaintWorklet) {
- visitor->Trace(paint_worklet_global_scope_);
MainThreadWorklet::Trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698