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

Unified Diff: components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h

Issue 2674653003: Use IOSImageDataFetcherWrapper in BrowserViewController (Closed)
Patch Set: Change IOSImageDataFetcherWrapper wrapping Created 3 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: components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h
diff --git a/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h
index ad1e9e997e72e28f26d34f27bc25656fc627a628..81b5f70dbdfccfb4c9b31f2289a0bb31ca6eae3c 100644
--- a/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h
+++ b/components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h
@@ -36,18 +36,30 @@ class IOSImageDataFetcherWrapper {
const scoped_refptr<base::TaskRunner>& task_runner);
virtual ~IOSImageDataFetcherWrapper();
- // Start downloading the image at the given |image_url|. The |callback| will
- // be called with the downloaded image, or nil if any error happened or the
- // http response header is not HTTP_OK (200). If the url is a data URL, the
- // http response header is considered to be HTTP_OK.
- // |callback| cannot be nil.
+ // Helper to start downloading and possibly decoding the image without a
+ // referrer.
virtual void FetchImageDataWebpDecoded(const GURL& image_url,
IOSImageDataFetcherCallback callback);
+ // Start downloading the image at the given |image_url|. The |callback| will
+ // be called with the downloaded image, or nil if any error happened. If the
+ // image is WebP it will be decoded.
+ // The |referrer| and |referrer_policy| will be passed on to the underlying
+ // URLFetcher.
+ // |callback| cannot be nil.
+ void FetchImageDataWebpDecoded(
+ const GURL& image_url,
+ IOSImageDataFetcherCallback callback,
+ const std::string& referrer,
+ net::URLRequest::ReferrerPolicy referrer_policy);
+
// Sets a service name against which to track data usage.
void SetDataUseServiceName(DataUseServiceName data_use_service_name);
private:
+ ImageDataFetcher::ImageDataFetcherCallback CallbackForImageDataFetcher(
+ IOSImageDataFetcherCallback callback);
+
// The task runner used to decode images if necessary.
const scoped_refptr<base::TaskRunner> task_runner_;
ImageDataFetcher image_data_fetcher_;
« no previous file with comments | « components/image_fetcher/image_data_fetcher.cc ('k') | components/image_fetcher/ios/ios_image_data_fetcher_wrapper.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698