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" |
11 #include "components/data_use_measurement/core/data_use_user_data.h" | 11 #include "components/data_use_measurement/core/data_use_user_data.h" |
12 #include "components/image_fetcher/image_data_fetcher.h" | 12 #include "components/image_fetcher/image_data_fetcher.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class TaskRunner; | 15 class TaskRunner; |
16 } | 16 } |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 class URLRequestContextGetter; | 19 class URLRequestContextGetter; |
20 } | 20 } |
21 | 21 |
22 class GURL; | 22 class GURL; |
23 | 23 |
24 namespace image_fetcher { | 24 namespace image_fetcher { |
25 | 25 |
26 // Callback that informs of the download of an image encoded in |data|. | 26 // Callback that informs of the download of an image encoded in |data| with the |
27 using IOSImageDataFetcherCallback = void (^)(NSData* data); | 27 // http |response_code| of the download. |
28 using IOSImageDataFetcherCallback = void (^)(NSData* data, | |
29 const int response_code); | |
sdefresne
2017/02/06 17:33:34
Remove "const" here. It is not really necessary (i
gambard
2017/02/07 10:03:33
Done.
| |
28 | 30 |
29 class IOSImageDataFetcherWrapper { | 31 class IOSImageDataFetcherWrapper { |
30 public: | 32 public: |
31 using DataUseServiceName = data_use_measurement::DataUseUserData::ServiceName; | 33 using DataUseServiceName = data_use_measurement::DataUseUserData::ServiceName; |
32 | 34 |
33 // The TaskRunner is used to decode the image if it is WebP-encoded. | 35 // The TaskRunner is used to decode the image if it is WebP-encoded. |
34 IOSImageDataFetcherWrapper( | 36 IOSImageDataFetcherWrapper( |
35 net::URLRequestContextGetter* url_request_context_getter, | 37 net::URLRequestContextGetter* url_request_context_getter, |
36 const scoped_refptr<base::TaskRunner>& task_runner); | 38 const scoped_refptr<base::TaskRunner>& task_runner); |
37 virtual ~IOSImageDataFetcherWrapper(); | 39 virtual ~IOSImageDataFetcherWrapper(); |
(...skipping 25 matching lines...) Expand all Loading... | |
63 // The task runner used to decode images if necessary. | 65 // The task runner used to decode images if necessary. |
64 const scoped_refptr<base::TaskRunner> task_runner_; | 66 const scoped_refptr<base::TaskRunner> task_runner_; |
65 ImageDataFetcher image_data_fetcher_; | 67 ImageDataFetcher image_data_fetcher_; |
66 | 68 |
67 DISALLOW_COPY_AND_ASSIGN(IOSImageDataFetcherWrapper); | 69 DISALLOW_COPY_AND_ASSIGN(IOSImageDataFetcherWrapper); |
68 }; | 70 }; |
69 | 71 |
70 } // namespace image_fetcher | 72 } // namespace image_fetcher |
71 | 73 |
72 #endif // COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ | 74 #endif // COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ |
OLD | NEW |