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

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

Issue 2431223009: [DevTools] paint worklet should report context destroyed (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/worklet/worklet-should-report-context-destroyed-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/worklet/worklet-should-report-context-destroyed-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698