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

Unified Diff: Source/core/dom/Document.cpp

Issue 1124153003: [Oilpan] [Reland] Migrate classes under core/fetch to Oilpan heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Check m_fetcher in DocumentLoader Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 54ab2be7d7b9cd06c5957495d4213e434870a6bb..d5a7cf9e6b63fb2e6295b51dd464960e149e1cf8 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -821,7 +821,7 @@ void Document::setImportsController(HTMLImportsController* controller)
{
ASSERT(!m_importsController || !controller);
m_importsController = controller;
- if (!m_importsController && !loader())
+ if (!m_importsController && !loader() && m_fetcher)
m_fetcher->clearContext();
}
@@ -2204,7 +2204,7 @@ void Document::detach(const AttachContext& context)
// to the DocumentLoader when possible also prevents prematurely clearing
// the context in the case where multiple Documents end up associated with
// a single DocumentLoader (e.g., navigating to a javascript: url).
- if (!loader())
+ if (!loader() && m_fetcher)
m_fetcher->clearContext();
// If this document is the master for an HTMLImportsController, sever that
// relationship. This ensures that we don't leave import loads in flight,
@@ -2233,6 +2233,8 @@ void Document::detach(const AttachContext& context)
// created by DOMImplementation::createDocument().
DocumentLifecycleNotifier::notifyContextDestroyed();
ExecutionContext::notifyContextDestroyed();
+
+ m_fetcher.clear();
}
void Document::removeAllEventListeners()
@@ -4635,7 +4637,8 @@ void Document::finishedParsing()
m_elementDataCacheClearTimer.startOneShot(10, FROM_HERE);
// Parser should have picked up all preloads by now
- m_fetcher->clearPreloads();
+ if (m_fetcher)
+ m_fetcher->clearPreloads();
}
void Document::elementDataCacheClearTimerFired(Timer<Document>*)

Powered by Google App Engine
This is Rietveld 408576698