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

Unified Diff: Source/core/loader/DocumentLoader.cpp

Issue 19574002: Refactoring: Introduce ResouceLoaderHost interface for unloading ResourceLoader. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another attempt Created 7 years, 5 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
« no previous file with comments | « Source/core/css/CSSFontSelector.cpp ('k') | Source/core/loader/ResourceLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentLoader.cpp
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index 4dd83d464b1ed558e76addb117b23ead50bbe0fa..edbb34c6b3c045d0f3ca82c40ac5329346146377 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -302,6 +302,9 @@ void DocumentLoader::notifyFinished(CachedResource* resource)
{
ASSERT_UNUSED(resource, m_mainResource == resource);
ASSERT(m_mainResource);
+
+ RefPtr<DocumentLoader> protect(this);
+
if (!m_mainResource->errorOccurred() && !m_mainResource->wasCanceled()) {
finishedLoading(m_mainResource->loadFinishTime());
return;
@@ -870,7 +873,7 @@ void DocumentLoader::setDefersLoading(bool defers)
// Multiple frames may be loading the same main resource simultaneously. If deferral state changes,
// each frame's DocumentLoader will try to send a setDefersLoading() to the same underlying ResourceLoader. Ensure only
// the "owning" DocumentLoader does so, as setDefersLoading() is not resilient to setting the same value repeatedly.
- if (mainResourceLoader() && mainResourceLoader()->documentLoader() == this)
+ if (mainResourceLoader() && mainResourceLoader()->isLoadedBy(m_cachedResourceLoader.get()))
mainResourceLoader()->setDefersLoading(defers);
setAllDefersLoading(m_resourceLoaders, defers);
« no previous file with comments | « Source/core/css/CSSFontSelector.cpp ('k') | Source/core/loader/ResourceLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698