Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_IMAGE_DATA_FETCHER_H_ | 5 #ifndef COMPONENTS_IMAGE_FETCHER_IMAGE_DATA_FETCHER_H_ |
| 6 #define COMPONENTS_IMAGE_FETCHER_IMAGE_DATA_FETCHER_H_ | 6 #define COMPONENTS_IMAGE_FETCHER_IMAGE_DATA_FETCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "components/data_use_measurement/core/data_use_user_data.h" | 15 #include "components/data_use_measurement/core/data_use_user_data.h" |
| 16 #include "net/url_request/url_fetcher_delegate.h" | 16 #include "net/url_request/url_fetcher_delegate.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 class URLFetcher; | 20 class URLFetcher; |
| 21 class URLRequestContextGetter; | 21 class URLRequestContextGetter; |
| 22 } // namespace net | 22 } // namespace net |
| 23 | 23 |
| 24 namespace image_fetcher { | 24 namespace image_fetcher { |
| 25 | 25 |
| 26 class ImageDataFetcher : public net::URLFetcherDelegate { | 26 class ImageDataFetcher : public net::URLFetcherDelegate { |
| 27 public: | 27 public: |
| 28 using ImageDataFetcherCallback = | 28 using ImageDataFetcherCallback = |
| 29 base::Callback<void(const std::string& image_data)>; | 29 base::Callback<void(const std::string& image_data, |
| 30 const net::URLFetcher* source)>; | |
|
Marc Treib
2017/01/25 10:37:55
You'll have to update the tests for the new param.
markusheintz_
2017/01/25 12:03:45
It would be great to learn what motivates this cha
gambard
2017/01/25 12:09:45
The IOSImageDataFetcher class is using the URLFetc
| |
| 30 | 31 |
| 31 using DataUseServiceName = data_use_measurement::DataUseUserData::ServiceName; | 32 using DataUseServiceName = data_use_measurement::DataUseUserData::ServiceName; |
| 32 | 33 |
| 33 explicit ImageDataFetcher( | 34 explicit ImageDataFetcher( |
| 34 net::URLRequestContextGetter* url_request_context_getter); | 35 net::URLRequestContextGetter* url_request_context_getter); |
| 35 ~ImageDataFetcher() override; | 36 ~ImageDataFetcher() override; |
| 36 | 37 |
| 37 // Sets a service name against which to track data usage. | 38 // Sets a service name against which to track data usage. |
| 38 void SetDataUseServiceName(DataUseServiceName data_use_service_name); | 39 void SetDataUseServiceName(DataUseServiceName data_use_service_name); |
| 39 | 40 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 63 // get individual URLFetchers and modify their state. Outside of tests this ID | 64 // get individual URLFetchers and modify their state. Outside of tests this ID |
| 64 // is not used. | 65 // is not used. |
| 65 int next_url_fetcher_id_; | 66 int next_url_fetcher_id_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(ImageDataFetcher); | 68 DISALLOW_COPY_AND_ASSIGN(ImageDataFetcher); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace image_fetcher | 71 } // namespace image_fetcher |
| 71 | 72 |
| 72 #endif // COMPONENTS_IMAGE_FETCHER_IMAGE_DATA_FETCHER_H_ | 73 #endif // COMPONENTS_IMAGE_FETCHER_IMAGE_DATA_FETCHER_H_ |
| OLD | NEW |