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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2362173002: Clear Document::m_frame after dispatching ContextLifecycleObesrver::contextDestroyed (Closed)
Patch Set: temp Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 2252 matching lines...) Expand 10 before | Expand all | Expand 10 after
2263 // relationship. This ensures that we don't leave import loads in flight, 2263 // relationship. This ensures that we don't leave import loads in flight,
2264 // thinking they should have access to a valid frame when they don't. 2264 // thinking they should have access to a valid frame when they don't.
2265 if (m_importsController) { 2265 if (m_importsController) {
2266 m_importsController->dispose(); 2266 m_importsController->dispose();
2267 setImportsController(nullptr); 2267 setImportsController(nullptr);
2268 } 2268 }
2269 2269
2270 m_timers.setTimerTaskRunner( 2270 m_timers.setTimerTaskRunner(
2271 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->cl one()); 2271 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->cl one());
2272 2272
2273 // This is required, as our LocalFrame might delete itself as soon as it det aches
2274 // us. However, this violates Node::detachLayoutTree() semantics, as it's ne ver
2275 // possible to re-attach. Eventually Document::detachLayoutTree() should be renamed,
2276 // or this setting of the frame to 0 could be made explicit in each of the
2277 // callers of Document::detachLayoutTree().
2278 m_frame = nullptr;
2279
2280 if (m_mediaQueryMatcher) 2273 if (m_mediaQueryMatcher)
2281 m_mediaQueryMatcher->documentDetached(); 2274 m_mediaQueryMatcher->documentDetached();
2282 2275
2283 m_lifecycle.advanceTo(DocumentLifecycle::Stopped); 2276 m_lifecycle.advanceTo(DocumentLifecycle::Stopped);
2284 2277
2285 // FIXME: Currently we call notifyContextDestroyed() only in 2278 // FIXME: Currently we call notifyContextDestroyed() only in
2286 // Document::detachLayoutTree(), which means that we don't call 2279 // Document::detachLayoutTree(), which means that we don't call
2287 // notifyContextDestroyed() for a document that doesn't get detached. 2280 // notifyContextDestroyed() for a document that doesn't get detached.
2288 // If such a document has any observer, the observer won't get 2281 // If such a document has any observer, the observer won't get
2289 // a contextDestroyed() notification. This can happen for a document 2282 // a contextDestroyed() notification. This can happen for a document
2290 // created by DOMImplementation::createDocument(). 2283 // created by DOMImplementation::createDocument().
2291 ExecutionContext::notifyContextDestroyed(); 2284 ExecutionContext::notifyContextDestroyed();
2285
2286 // This is required, as our LocalFrame might delete itself as soon as it det aches
2287 // us. However, this violates Node::detachLayoutTree() semantics, as it's ne ver
2288 // possible to re-attach. Eventually Document::detachLayoutTree() should be renamed,
2289 // or this setting of the frame to 0 could be made explicit in each of the
2290 // callers of Document::detachLayoutTree().
2291 m_frame = nullptr;
2292 } 2292 }
2293 2293
2294 void Document::removeAllEventListeners() 2294 void Document::removeAllEventListeners()
2295 { 2295 {
2296 ContainerNode::removeAllEventListeners(); 2296 ContainerNode::removeAllEventListeners();
2297 2297
2298 if (LocalDOMWindow* domWindow = this->domWindow()) 2298 if (LocalDOMWindow* domWindow = this->domWindow())
2299 domWindow->removeAllEventListeners(); 2299 domWindow->removeAllEventListeners();
2300 } 2300 }
2301 2301
(...skipping 3783 matching lines...) Expand 10 before | Expand all | Expand 10 after
6085 } 6085 }
6086 6086
6087 void showLiveDocumentInstances() 6087 void showLiveDocumentInstances()
6088 { 6088 {
6089 WeakDocumentSet& set = liveDocumentSet(); 6089 WeakDocumentSet& set = liveDocumentSet();
6090 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6090 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6091 for (Document* document : set) 6091 for (Document* document : set)
6092 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6092 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6093 } 6093 }
6094 #endif 6094 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698