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

Unified Diff: content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc

Issue 16358002: Allow MultiResolutionImageFetcher to fetch image from file:/// protocol (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: check url is file protocol instead Created 7 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc
diff --git a/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc b/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc
index f3c79b3cef0f130a5f1b50b1115a64f87d1248c4..2eb0abaca1e71b64fc8c0b8a9de9789ec1a0668a 100644
--- a/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc
+++ b/content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc
@@ -44,7 +44,8 @@ void MultiResolutionImageResourceFetcher::OnURLFetchComplete(
std::vector<SkBitmap> bitmaps;
if (!response.isNull()) {
http_status_code_ = response.httpStatusCode();
- if (http_status_code_ == 200) {
+ GURL url = static_cast<GURL>(response.url());
abarth-chromium 2013/06/13 20:07:39 No need for a static_cast here.
Hongbo Min 2013/07/01 05:39:33 Since I don't want to rely on the implicit type co
abarth-chromium 2013/07/01 05:53:34 Why not? WebURL is designed to implicitly convert
Hongbo Min 2013/07/04 08:49:36 Done.
+ if (http_status_code_ == 200 || url.SchemeIsFile()) {
// Request succeeded, try to convert it to an image.
bitmaps = webkit_glue::ImageDecoder::DecodeAll(
reinterpret_cast<const unsigned char*>(data.data()), data.size());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698