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

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

Issue 2114213002: Fix loading placeholders for Lo-Fi (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whitespace fix and rebase Created 4 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
Index: third_party/WebKit/Source/core/fetch/ImageResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
index c10b9a9682ccdc81789ec0b463f4832a8b7b1a9c..884d7f0c5289bda8ac3d701781e660ea291d51e9 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -511,14 +511,17 @@ void ImageResource::updateImageAnimationPolicy()
void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher)
{
- if (!m_response.httpHeaderField("chrome-proxy").contains("q=low"))
+ if (m_resourceRequest.loFiState() != WebURLRequest::LoFiOn)
+ return;
+ if (isLoaded() && !m_response.httpHeaderField("chrome-proxy").contains("q=low"))
return;
m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache);
m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
if (isLoading())
m_loader->cancel();
- else
- updateImageAndClearBuffer();
+ clear();
+ m_data.clear();
+ notifyObservers();
setStatus(NotStarted);
fetcher->startLoad(this);
}

Powered by Google App Engine
This is Rietveld 408576698