| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ |
| 6 #define CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ | 6 #define CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "content/common/image_downloader/image_downloader.mojom.h" | 14 #include "content/common/image_downloader/image_downloader.mojom.h" |
| 15 #include "content/public/renderer/render_frame_observer.h" | 15 #include "content/public/renderer/render_frame_observer.h" |
| 16 #include "content/public/renderer/render_process_observer.h" |
| 16 #include "mojo/public/cpp/bindings/strong_binding.h" | 17 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 18 | 19 |
| 19 class SkBitmap; | 20 class SkBitmap; |
| 20 | 21 |
| 21 namespace gfx { | 22 namespace gfx { |
| 22 class Size; | 23 class Size; |
| 23 } | 24 } |
| 24 | 25 |
| 25 namespace content { | 26 namespace content { |
| 26 | 27 |
| 27 class MultiResolutionImageResourceFetcher; | 28 class MultiResolutionImageResourceFetcher; |
| 28 class RenderFrame; | 29 class RenderFrame; |
| 29 | 30 |
| 30 class ImageDownloaderImpl : public content::mojom::ImageDownloader, | 31 class ImageDownloaderImpl : public content::mojom::ImageDownloader, |
| 31 public RenderFrameObserver { | 32 public RenderFrameObserver, |
| 33 public RenderProcessObserver { |
| 32 public: | 34 public: |
| 33 static void CreateMojoService( | 35 static void CreateMojoService( |
| 34 RenderFrame* render_frame, | 36 RenderFrame* render_frame, |
| 35 mojo::InterfaceRequest<content::mojom::ImageDownloader> request); | 37 mojo::InterfaceRequest<content::mojom::ImageDownloader> request); |
| 36 | 38 |
| 39 // RenderProcessObserver implementation. |
| 40 void OnRenderProcessShutdown() override; |
| 41 |
| 37 private: | 42 private: |
| 38 ImageDownloaderImpl( | 43 ImageDownloaderImpl( |
| 39 RenderFrame* render_frame, | 44 RenderFrame* render_frame, |
| 40 mojo::InterfaceRequest<content::mojom::ImageDownloader> request); | 45 mojo::InterfaceRequest<content::mojom::ImageDownloader> request); |
| 41 ~ImageDownloaderImpl() override; | 46 ~ImageDownloaderImpl() override; |
| 42 | 47 |
| 43 // ImageDownloader methods: | 48 // ImageDownloader methods: |
| 44 void DownloadImage(const mojo::String& url, | 49 void DownloadImage(const mojo::String& url, |
| 45 bool is_favicon, | 50 bool is_favicon, |
| 46 uint32_t max_bitmap_size, | 51 uint32_t max_bitmap_size, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 90 |
| 86 // ImageResourceFetchers schedule via FetchImage. | 91 // ImageResourceFetchers schedule via FetchImage. |
| 87 ImageResourceFetcherList image_fetchers_; | 92 ImageResourceFetcherList image_fetchers_; |
| 88 | 93 |
| 89 DISALLOW_COPY_AND_ASSIGN(ImageDownloaderImpl); | 94 DISALLOW_COPY_AND_ASSIGN(ImageDownloaderImpl); |
| 90 }; | 95 }; |
| 91 | 96 |
| 92 } // namespace content | 97 } // namespace content |
| 93 | 98 |
| 94 #endif // CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ | 99 #endif // CONTENT_RENDERER_IMAGE_DOWNLOADER_IMAGE_DOWNLOADER_IMPL_H_ |
| OLD | NEW |