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

Side by Side Diff: components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h

Issue 2677993002: Use IOSImageDataFetcherWrapper for favicon (Closed)
Patch Set: Actually adding the header 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 unified diff | Download patch
OLDNEW
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| and the
27 // associated metadata. If an error prevented a http response,
28 // |metadata.http_response_code| will be RESPONSE_CODE_INVALID.
27 using IOSImageDataFetcherCallback = void (^)(NSData* data, 29 using IOSImageDataFetcherCallback = void (^)(NSData* data,
28 const RequestMetadata& metadata); 30 const RequestMetadata& metadata);
29 31
30 class IOSImageDataFetcherWrapper { 32 class IOSImageDataFetcherWrapper {
31 public: 33 public:
32 using DataUseServiceName = data_use_measurement::DataUseUserData::ServiceName; 34 using DataUseServiceName = data_use_measurement::DataUseUserData::ServiceName;
33 35
34 // The TaskRunner is used to decode the image if it is WebP-encoded. 36 // The TaskRunner is used to decode the image if it is WebP-encoded.
35 IOSImageDataFetcherWrapper( 37 IOSImageDataFetcherWrapper(
36 net::URLRequestContextGetter* url_request_context_getter, 38 net::URLRequestContextGetter* url_request_context_getter,
(...skipping 27 matching lines...) Expand all
64 // The task runner used to decode images if necessary. 66 // The task runner used to decode images if necessary.
65 const scoped_refptr<base::TaskRunner> task_runner_; 67 const scoped_refptr<base::TaskRunner> task_runner_;
66 ImageDataFetcher image_data_fetcher_; 68 ImageDataFetcher image_data_fetcher_;
67 69
68 DISALLOW_COPY_AND_ASSIGN(IOSImageDataFetcherWrapper); 70 DISALLOW_COPY_AND_ASSIGN(IOSImageDataFetcherWrapper);
69 }; 71 };
70 72
71 } // namespace image_fetcher 73 } // namespace image_fetcher
72 74
73 #endif // COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_ 75 #endif // COMPONENTS_IMAGE_FETCHER_IOS_IOS_IMAGE_DATA_FETCHER_WRAPPER_H_
OLDNEW
« no previous file with comments | « components/image_fetcher/image_data_fetcher_unittest.cc ('k') | components/image_fetcher/request_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698