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

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 1923003002: Clear Resource::m_loader in Resource::finish() and Resource::error() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, comment in background.js 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/fetch/Resource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
index 3f3998348edef24091d3dcd6745b3be30374fd37..91175f1b88a4f02ed950e3580d0a8d5bad26be3c 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -425,6 +425,7 @@ void Resource::error(const ResourceError& error)
setStatus(LoadError);
ASSERT(errorOccurred());
m_data.clear();
+ m_loader = nullptr;
checkNotify();
markClientsAndObserversFinished();
}
@@ -435,6 +436,7 @@ void Resource::finish(double loadFinishTime)
m_loadFinishTime = loadFinishTime;
if (!errorOccurred())
m_status = Cached;
+ m_loader = nullptr;
checkNotify();
markClientsAndObserversFinished();
}
@@ -651,11 +653,6 @@ String Resource::reasonNotDeletable() const
return builder.toString();
}
-void Resource::clearLoader()
-{
- m_loader = nullptr;
-}
-
void Resource::didAddClient(ResourceClient* c)
{
if (isLoaded()) {
@@ -774,10 +771,8 @@ void Resource::allClientsAndObserversRemoved()
void Resource::cancelTimerFired(Timer<Resource>* timer)
{
ASSERT_UNUSED(timer, timer == &m_cancelTimer);
- if (hasClientsOrObservers() || !m_loader)
- return;
- m_loader->cancelIfNotFinishing();
- memoryCache()->remove(this);
hiroshige 2016/05/11 09:28:38 Could you mention in the CL description that this
Nate Chapin 2016/05/11 18:49:53 Done.
+ if (!hasClientsOrObservers() && m_loader)
+ m_loader->cancel();
}
void Resource::setDecodedSize(size_t decodedSize)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698