| 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 CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_BASE_H_ | 5 #ifndef CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_BASE_H_ |
| 6 #define CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_BASE_H_ | 6 #define CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_BASE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 #include "base/memory/scoped_vector.h" | |
| 14 #include "content/public/renderer/render_frame_observer.h" | 14 #include "content/public/renderer/render_frame_observer.h" |
| 15 #include "content/public/renderer/render_thread_observer.h" | 15 #include "content/public/renderer/render_thread_observer.h" |
| 16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 class MultiResolutionImageResourceFetcher; | 21 class MultiResolutionImageResourceFetcher; |
| 22 class RenderFrame; | 22 class RenderFrame; |
| 23 | 23 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 54 bool bypass_cache, | 54 bool bypass_cache, |
| 55 const DownloadCallback& callback); | 55 const DownloadCallback& callback); |
| 56 | 56 |
| 57 // This callback is triggered when FetchImage completes, either | 57 // This callback is triggered when FetchImage completes, either |
| 58 // succesfully or with a failure. See FetchImage for more | 58 // succesfully or with a failure. See FetchImage for more |
| 59 // details. | 59 // details. |
| 60 void DidFetchImage(const DownloadCallback& callback, | 60 void DidFetchImage(const DownloadCallback& callback, |
| 61 MultiResolutionImageResourceFetcher* fetcher, | 61 MultiResolutionImageResourceFetcher* fetcher, |
| 62 const std::vector<SkBitmap>& images); | 62 const std::vector<SkBitmap>& images); |
| 63 | 63 |
| 64 typedef ScopedVector<MultiResolutionImageResourceFetcher> | 64 typedef std::vector<std::unique_ptr<MultiResolutionImageResourceFetcher>> |
| 65 ImageResourceFetcherList; | 65 ImageResourceFetcherList; |
| 66 | 66 |
| 67 // ImageResourceFetchers schedule via FetchImage. | 67 // ImageResourceFetchers schedule via FetchImage. |
| 68 ImageResourceFetcherList image_fetchers_; | 68 ImageResourceFetcherList image_fetchers_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(ImageDownloaderBase); | 70 DISALLOW_COPY_AND_ASSIGN(ImageDownloaderBase); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace content | 73 } // namespace content |
| 74 | 74 |
| 75 #endif // CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_BASE_H_ | 75 #endif // CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_BASE_H_ |
| OLD | NEW |