| OLD | NEW |
| 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 #include "modules/csspaint/PaintWorkletGlobalScope.h" | 5 #include "modules/csspaint/PaintWorkletGlobalScope.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8BindingMacros.h" | 7 #include "bindings/core/v8/V8BindingMacros.h" |
| 8 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" | 8 #include "bindings/core/v8/WorkerOrWorkletScriptController.h" |
| 9 #include "core/CSSPropertyNames.h" | 9 #include "core/CSSPropertyNames.h" |
| 10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 v8::Isolate* isolate) | 40 v8::Isolate* isolate) |
| 41 : MainThreadWorkletGlobalScope(frame, | 41 : MainThreadWorkletGlobalScope(frame, |
| 42 url, | 42 url, |
| 43 userAgent, | 43 userAgent, |
| 44 std::move(securityOrigin), | 44 std::move(securityOrigin), |
| 45 isolate) {} | 45 isolate) {} |
| 46 | 46 |
| 47 PaintWorkletGlobalScope::~PaintWorkletGlobalScope() {} | 47 PaintWorkletGlobalScope::~PaintWorkletGlobalScope() {} |
| 48 | 48 |
| 49 void PaintWorkletGlobalScope::dispose() { | 49 void PaintWorkletGlobalScope::dispose() { |
| 50 MainThreadDebugger::instance()->contextWillBeDestroyed( |
| 51 scriptController()->getScriptState()); |
| 50 // Explicitly clear the paint defininitions to break a reference cycle | 52 // Explicitly clear the paint defininitions to break a reference cycle |
| 51 // between them and this global scope. | 53 // between them and this global scope. |
| 52 m_paintDefinitions.clear(); | 54 m_paintDefinitions.clear(); |
| 53 | 55 |
| 54 WorkletGlobalScope::dispose(); | 56 WorkletGlobalScope::dispose(); |
| 55 } | 57 } |
| 56 | 58 |
| 57 void PaintWorkletGlobalScope::registerPaint(const String& name, | 59 void PaintWorkletGlobalScope::registerPaint(const String& name, |
| 58 const ScriptValue& ctorValue, | 60 const ScriptValue& ctorValue, |
| 59 ExceptionState& exceptionState) { | 61 ExceptionState& exceptionState) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 set->add(generator); | 186 set->add(generator); |
| 185 } | 187 } |
| 186 | 188 |
| 187 DEFINE_TRACE(PaintWorkletGlobalScope) { | 189 DEFINE_TRACE(PaintWorkletGlobalScope) { |
| 188 visitor->trace(m_paintDefinitions); | 190 visitor->trace(m_paintDefinitions); |
| 189 visitor->trace(m_pendingGenerators); | 191 visitor->trace(m_pendingGenerators); |
| 190 MainThreadWorkletGlobalScope::trace(visitor); | 192 MainThreadWorkletGlobalScope::trace(visitor); |
| 191 } | 193 } |
| 192 | 194 |
| 193 } // namespace blink | 195 } // namespace blink |
| OLD | NEW |