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

Unified Diff: webkit/glue/multi_resolution_image_resource_fetcher.cc

Issue 14322023: Don't request missing favicon on every page request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Propagate HTTP Status Code to FaviconTabHelper::DidDownloadFavicon, Clear Missing Favicons on RELOA… Created 7 years, 8 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: webkit/glue/multi_resolution_image_resource_fetcher.cc
diff --git a/webkit/glue/multi_resolution_image_resource_fetcher.cc b/webkit/glue/multi_resolution_image_resource_fetcher.cc
index e562cf97f6e82a28020fcdb27d2162aff21cd426..040f115f1d2f6c64dfabc13d0bec1f9d962eeec4 100644
--- a/webkit/glue/multi_resolution_image_resource_fetcher.cc
+++ b/webkit/glue/multi_resolution_image_resource_fetcher.cc
@@ -25,6 +25,7 @@ MultiResolutionImageResourceFetcher::MultiResolutionImageResourceFetcher(
const Callback& callback)
: callback_(callback),
id_(id),
+ http_status_code_(0),
image_url_(image_url) {
fetcher_.reset(new ResourceFetcher(
image_url, frame, target_type,
@@ -41,10 +42,13 @@ void MultiResolutionImageResourceFetcher::OnURLFetchComplete(
const WebURLResponse& response,
const std::string& data) {
std::vector<SkBitmap> bitmaps;
- if (!response.isNull() && response.httpStatusCode() == 200) {
- // Request succeeded, try to convert it to an image.
- bitmaps = ImageDecoder::DecodeAll(
- reinterpret_cast<const unsigned char*>(data.data()), data.size());
+ if (!response.isNull()) {
+ http_status_code_ = response.httpStatusCode();
+ if (http_status_code_ == 200) {
+ // Request succeeded, try to convert it to an image.
+ bitmaps = ImageDecoder::DecodeAll(
+ reinterpret_cast<const unsigned char*>(data.data()), data.size());
+ }
} // else case:
// If we get here, it means no image from server or couldn't decode the
// response as an image. The delegate will see an empty vector.

Powered by Google App Engine
This is Rietveld 408576698