| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CORE_IMAGE_FETCHER_IMPL_H_ | 5 #ifndef COMPONENTS_IMAGE_FETCHER_CORE_IMAGE_FETCHER_IMPL_H_ |
| 6 #define COMPONENTS_IMAGE_FETCHER_CORE_IMAGE_FETCHER_IMPL_H_ | 6 #define COMPONENTS_IMAGE_FETCHER_CORE_IMAGE_FETCHER_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // Sets the |delegate| of the ImageFetcherImpl. The |delegate| has to be alive | 39 // Sets the |delegate| of the ImageFetcherImpl. The |delegate| has to be alive |
| 40 // during the lifetime of the ImageFetcherImpl object. It is the caller's | 40 // during the lifetime of the ImageFetcherImpl object. It is the caller's |
| 41 // responsibility to ensure this. | 41 // responsibility to ensure this. |
| 42 void SetImageFetcherDelegate(ImageFetcherDelegate* delegate) override; | 42 void SetImageFetcherDelegate(ImageFetcherDelegate* delegate) override; |
| 43 | 43 |
| 44 // Sets a service name against which to track data usage. | 44 // Sets a service name against which to track data usage. |
| 45 void SetDataUseServiceName(DataUseServiceName data_use_service_name) override; | 45 void SetDataUseServiceName(DataUseServiceName data_use_service_name) override; |
| 46 | 46 |
| 47 void SetDesiredImageFrameSize(const gfx::Size& size) override; | 47 void SetDesiredImageFrameSize(const gfx::Size& size) override; |
| 48 | 48 |
| 49 void SetImageDownloadLimit( |
| 50 base::Optional<int64_t> max_download_bytes) override; |
| 51 |
| 49 void StartOrQueueNetworkRequest( | 52 void StartOrQueueNetworkRequest( |
| 50 const std::string& id, | 53 const std::string& id, |
| 51 const GURL& image_url, | 54 const GURL& image_url, |
| 52 const ImageFetcherCallback& callback) override; | 55 const ImageFetcherCallback& callback) override; |
| 53 | 56 |
| 54 ImageDecoder* GetImageDecoder() override; | 57 ImageDecoder* GetImageDecoder() override; |
| 55 | 58 |
| 56 private: | 59 private: |
| 57 // State related to an image fetch (id, pending callbacks). | 60 // State related to an image fetch (id, pending callbacks). |
| 58 struct ImageRequest { | 61 struct ImageRequest { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 // Map from each image URL to the request information (associated website | 101 // Map from each image URL to the request information (associated website |
| 99 // url, fetcher, pending callbacks). | 102 // url, fetcher, pending callbacks). |
| 100 ImageRequestMap pending_net_requests_; | 103 ImageRequestMap pending_net_requests_; |
| 101 | 104 |
| 102 DISALLOW_COPY_AND_ASSIGN(ImageFetcherImpl); | 105 DISALLOW_COPY_AND_ASSIGN(ImageFetcherImpl); |
| 103 }; | 106 }; |
| 104 | 107 |
| 105 } // namespace image_fetcher | 108 } // namespace image_fetcher |
| 106 | 109 |
| 107 #endif // COMPONENTS_IMAGE_FETCHER_CORE_IMAGE_FETCHER_IMPL_H_ | 110 #endif // COMPONENTS_IMAGE_FETCHER_CORE_IMAGE_FETCHER_IMPL_H_ |
| OLD | NEW |