| 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
|
|
|