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

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

Issue 2407573002: Wait to notify completion until after a Lo-Fi image is reloaded. (Closed)
Patch Set: Created 4 years, 2 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 d0de8259a3b53162531e2bb2d529296f5f0cf925..f684f39cc921044fa52872e731db0c99c9d34c1b 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -317,6 +317,7 @@ Resource::Resource(const ResourceRequest& request,
m_isAlive(false),
m_integrityDisposition(ResourceIntegrityDisposition::NotChecked),
m_isAddRemoveClientProhibited(false),
+ m_isNotifyClientsOfCompletionProhibited(false),
Nate Chapin 2016/10/10 23:47:49 I'm suspicious this can be on ImageResource instea
sclittle 2016/10/11 02:56:56 Only the completion callbacks are being suppressed
Nate Chapin 2016/10/12 22:56:17 I'm not certain how much of a risk this is in prac
sclittle 2016/10/12 23:38:16 Good point, sorry, I forgot about ImageResource::d
m_options(options),
m_responseTimestamp(currentTime()),
m_cancelTimer(this, &Resource::cancelTimerFired),
@@ -356,7 +357,7 @@ void Resource::checkNotify() {
}
void Resource::notifyClientsInternal(MarkFinishedOption markFinishedOption) {
- if (isLoading())
+ if (isLoading() || m_isNotifyClientsOfCompletionProhibited)
return;
ResourceClientWalker<ResourceClient> w(m_clients);
@@ -656,7 +657,7 @@ String Resource::reasonNotDeletable() const {
}
void Resource::didAddClient(ResourceClient* c) {
- if (isLoaded()) {
+ if (isLoaded() && !m_isNotifyClientsOfCompletionProhibited) {
c->notifyFinished(this);
if (m_clients.contains(c)) {
m_finishedClients.add(c);

Powered by Google App Engine
This is Rietveld 408576698