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

Unified Diff: content/renderer/image_loading_helper.cc

Issue 934693002: Reload favicon from HTTP cache on Ctrl+Refresh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « content/renderer/image_loading_helper.h ('k') | extensions/browser/app_window/app_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/image_loading_helper.cc
diff --git a/content/renderer/image_loading_helper.cc b/content/renderer/image_loading_helper.cc
index 7b7982ab8058b2acb72737426fe0139c95168985..afd0fee406d5e7b8e118a2ba1af16c7010e24b38 100644
--- a/content/renderer/image_loading_helper.cc
+++ b/content/renderer/image_loading_helper.cc
@@ -104,10 +104,12 @@ ImageLoadingHelper::ImageLoadingHelper(RenderFrame* render_frame)
ImageLoadingHelper::~ImageLoadingHelper() {
}
-void ImageLoadingHelper::OnDownloadImage(int id,
- const GURL& image_url,
- bool is_favicon,
- uint32_t max_image_size) {
+void ImageLoadingHelper::OnDownloadImage(
+ int id,
+ const GURL& image_url,
+ bool is_favicon,
+ uint32_t max_image_size,
+ bool bypass_cache) {
std::vector<SkBitmap> result_images;
std::vector<gfx::Size> result_original_image_sizes;
if (image_url.SchemeIs(url::kDataScheme)) {
@@ -118,7 +120,8 @@ void ImageLoadingHelper::OnDownloadImage(int id,
gfx::Size(data_image.width(), data_image.height()));
}
} else {
- if (DownloadImage(id, image_url, is_favicon, max_image_size)) {
+ if (DownloadImage(id, image_url, is_favicon, max_image_size,
+ bypass_cache)) {
// Will complete asynchronously via ImageLoadingHelper::DidDownloadImage
return;
}
@@ -132,19 +135,20 @@ void ImageLoadingHelper::OnDownloadImage(int id,
result_original_image_sizes));
}
-bool ImageLoadingHelper::DownloadImage(int id,
- const GURL& image_url,
- bool is_favicon,
- uint32_t max_image_size) {
+bool ImageLoadingHelper::DownloadImage(
+ int id,
+ const GURL& image_url,
+ bool is_favicon,
+ uint32_t max_image_size,
+ bool bypass_cache) {
// Create an image resource fetcher and assign it with a call back object.
image_fetchers_.push_back(new MultiResolutionImageResourceFetcher(
- image_url,
- render_frame()->GetWebFrame(),
- id,
+ image_url, render_frame()->GetWebFrame(), id,
is_favicon ? WebURLRequest::RequestContextFavicon
: WebURLRequest::RequestContextImage,
- base::Bind(&ImageLoadingHelper::DidDownloadImage,
- base::Unretained(this),
+ bypass_cache ? WebURLRequest::ReloadBypassingCache
+ : WebURLRequest::UseProtocolCachePolicy,
+ base::Bind(&ImageLoadingHelper::DidDownloadImage, base::Unretained(this),
max_image_size)));
return true;
}
« no previous file with comments | « content/renderer/image_loading_helper.h ('k') | extensions/browser/app_window/app_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698