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

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

Issue 1914183002: Simplify ownership handling of HTMLImportsController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drop Finalized Created 4 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 unified diff | Download patch
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 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 // If this Document is associated with a live DocumentLoader, the 2220 // If this Document is associated with a live DocumentLoader, the
2221 // DocumentLoader will take care of clearing the FetchContext. Deferring 2221 // DocumentLoader will take care of clearing the FetchContext. Deferring
2222 // to the DocumentLoader when possible also prevents prematurely clearing 2222 // to the DocumentLoader when possible also prevents prematurely clearing
2223 // the context in the case where multiple Documents end up associated with 2223 // the context in the case where multiple Documents end up associated with
2224 // a single DocumentLoader (e.g., navigating to a javascript: url). 2224 // a single DocumentLoader (e.g., navigating to a javascript: url).
2225 if (!loader()) 2225 if (!loader())
2226 m_fetcher->clearContext(); 2226 m_fetcher->clearContext();
2227 // If this document is the master for an HTMLImportsController, sever that 2227 // If this document is the master for an HTMLImportsController, sever that
2228 // relationship. This ensures that we don't leave import loads in flight, 2228 // relationship. This ensures that we don't leave import loads in flight,
2229 // thinking they should have access to a valid frame when they don't. 2229 // thinking they should have access to a valid frame when they don't.
2230 if (m_importsController) 2230 if (m_importsController) {
2231 HTMLImportsController::removeFrom(*this); 2231 m_importsController->dispose();
2232 setImportsController(nullptr);
2233 }
2232 2234
2233 m_timers.setTimerTaskRunner( 2235 m_timers.setTimerTaskRunner(
2234 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->ad optClone()); 2236 Platform::current()->currentThread()->scheduler()->timerTaskRunner()->ad optClone());
2235 2237
2236 // This is required, as our LocalFrame might delete itself as soon as it det aches 2238 // This is required, as our LocalFrame might delete itself as soon as it det aches
2237 // us. However, this violates Node::detach() semantics, as it's never 2239 // us. However, this violates Node::detach() semantics, as it's never
2238 // possible to re-attach. Eventually Document::detach() should be renamed, 2240 // possible to re-attach. Eventually Document::detach() should be renamed,
2239 // or this setting of the frame to 0 could be made explicit in each of the 2241 // or this setting of the frame to 0 could be made explicit in each of the
2240 // callers of Document::detach(). 2242 // callers of Document::detach().
2241 m_frame = nullptr; 2243 m_frame = nullptr;
(...skipping 3663 matching lines...) Expand 10 before | Expand all | Expand 10 after
5905 #ifndef NDEBUG 5907 #ifndef NDEBUG
5906 using namespace blink; 5908 using namespace blink;
5907 void showLiveDocumentInstances() 5909 void showLiveDocumentInstances()
5908 { 5910 {
5909 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5911 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5910 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5912 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5911 for (Document* document : set) 5913 for (Document* document : set)
5912 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 5914 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
5913 } 5915 }
5914 #endif 5916 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/html/imports/HTMLImportsController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698