OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ | 5 #ifndef COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ |
6 #define COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ | 6 #define COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 IOSImageDataFetcherWrapper( | 34 IOSImageDataFetcherWrapper( |
35 net::URLRequestContextGetter* url_request_context_getter, | 35 net::URLRequestContextGetter* url_request_context_getter, |
36 const scoped_refptr<base::TaskRunner>& task_runner); | 36 const scoped_refptr<base::TaskRunner>& task_runner); |
37 virtual ~IOSImageDataFetcherWrapper(); | 37 virtual ~IOSImageDataFetcherWrapper(); |
38 | 38 |
39 // Start downloading the image at the given |image_url|. The |callback| will | 39 // Start downloading the image at the given |image_url|. The |callback| will |
40 // be called with the downloaded image, or nil if any error happened or the | 40 // be called with the downloaded image, or nil if any error happened or the |
41 // http response header is not HTTP_OK (200). If the url is a data URL, the | 41 // http response header is not HTTP_OK (200). If the url is a data URL, the |
42 // http response header is considered to be HTTP_OK. | 42 // http response header is considered to be HTTP_OK. |
43 // |callback| cannot be nil. | 43 // |callback| cannot be nil. |
44 void FetchImageDataWebpDecoded(const GURL& image_url, | 44 virtual void FetchImageDataWebpDecoded(const GURL& image_url, |
45 IOSImageDataFetcherCallback callback); | 45 IOSImageDataFetcherCallback callback); |
46 | 46 |
47 // Sets a service name against which to track data usage. | 47 // Sets a service name against which to track data usage. |
48 void SetDataUseServiceName(DataUseServiceName data_use_service_name); | 48 void SetDataUseServiceName(DataUseServiceName data_use_service_name); |
49 | 49 |
50 private: | 50 private: |
51 // The task runner used to decode images if necessary. | 51 // The task runner used to decode images if necessary. |
52 const scoped_refptr<base::TaskRunner> task_runner_; | 52 const scoped_refptr<base::TaskRunner> task_runner_; |
53 ImageDataFetcher image_data_fetcher_; | 53 ImageDataFetcher image_data_fetcher_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(IOSImageDataFetcherWrapper); | 55 DISALLOW_COPY_AND_ASSIGN(IOSImageDataFetcherWrapper); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace image_fetcher | 58 } // namespace image_fetcher |
59 | 59 |
60 #endif // COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ | 60 #endif // COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ |
OLD | NEW |