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

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

Issue 2903703003: Use wrapper tracing for worklets. (Closed)
Patch Set: Separating in two CLs 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
index 253e21493dc82ae0687383daaf38fe8338d4c2fa..d82cd5f58b99626e23ab89136c6ea2831143aa9c 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
@@ -57,10 +57,6 @@ void PaintWorkletGlobalScope::Dispose() {
MainThreadDebugger::Instance()->ContextWillBeDestroyed(
ScriptController()->GetScriptState());
- // Explicitly clear the paint defininitions to break a reference cycle
- // between them and this global scope.
- paint_definitions_.clear();
-
pending_generator_registry_ = nullptr;
WorkletGlobalScope::Dispose();
}
@@ -198,7 +194,8 @@ void PaintWorkletGlobalScope::registerPaint(const String& name,
ScriptController()->GetScriptState(), constructor, paint,
native_invalidation_properties, custom_invalidation_properties,
input_argument_types, has_alpha);
- paint_definitions_.Set(name, definition);
+ paint_definitions_.Set(
+ name, TraceWrapperMember<CSSPaintDefinition>(this, definition));
pending_generator_registry_->SetDefinition(name, definition);
}
@@ -213,4 +210,10 @@ DEFINE_TRACE(PaintWorkletGlobalScope) {
MainThreadWorkletGlobalScope::Trace(visitor);
}
+DEFINE_TRACE_WRAPPERS(PaintWorkletGlobalScope) {
+ for (auto definition : paint_definitions_)
+ visitor->TraceWrappers(definition.value);
+ MainThreadWorkletGlobalScope::TraceWrappers(visitor);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698