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

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

Issue 1624583003: Reload Lo-Fi images inline instead of reloading the whole page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added comment Created 4 years, 10 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 6395714499de125843536a2427f34ecaa71bd934..aad9d355cc05e6bc1a9497ca813ac60010c4dd79 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -432,6 +432,16 @@ void ImageResource::updateImageAnimationPolicy()
}
}
+void ImageResource::reloadIfLoFi(ResourceFetcher* fetcher)
+{
+ if (!m_response.httpHeaderField("chrome-proxy").contains("q=low"))
+ return;
+ m_resourceRequest.setCachePolicy(ResourceRequestCachePolicy::ReloadBypassingCache);
+ m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff);
+ error(Resource::LoadError);
+ load(fetcher, fetcher->defaultResourceOptions());
+}
+
void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect)
{
if (!image || image != m_image)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698