| Index: content/browser/image_downloader/image_downloader_dispatcher.h
|
| diff --git a/content/browser/image_downloader/image_downloader_dispatcher.h b/content/browser/image_downloader/image_downloader_dispatcher.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..23a15548c6a219f94daf10966d975ed3f09697b4
|
| --- /dev/null
|
| +++ b/content/browser/image_downloader/image_downloader_dispatcher.h
|
| @@ -0,0 +1,49 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_BROWSER_IMAGE_DOWNLOADER_DISPATCHER_H_
|
| +#define CONTENT_BROWSER_IMAGE_DOWNLOADER_DISPATCHER_H_
|
| +
|
| +#include "base/macros.h"
|
| +#include "content/common/image_downloader/image_downloader.mojom.h"
|
| +#include "content/public/browser/web_contents.h"
|
| +
|
| +class GURL;
|
| +
|
| +namespace content {
|
| +
|
| +class RenderFrameHost;
|
| +
|
| +// ImageDownloaderDispatcher is specific with RenderFrameHost and
|
| +// responsible for the Mojo connection with ImageDownloader Mojo service
|
| +// in RenderFrame.
|
| +// ImageDownloaderDispatcher provides StartDownload API,
|
| +// send download request via the Mojo connection,
|
| +// and callback caller once got result from the Mojo connection.
|
| +class ImageDownloaderDispatcher : public mojo::ErrorHandler {
|
| + public:
|
| + explicit ImageDownloaderDispatcher(RenderFrameHost* render_frame_host);
|
| + ~ImageDownloaderDispatcher() override;
|
| +
|
| + int StartDownload(const GURL& url,
|
| + bool is_favicon,
|
| + uint32_t max_bitmap_size,
|
| + bool bypass_cache,
|
| + const WebContents::ImageDownloadCallback& callback);
|
| +
|
| + private:
|
| + // Overidden from mojo::ErrorHandler:
|
| + void OnConnectionError() override;
|
| +
|
| + static int next_image_download_id_;
|
| +
|
| + RenderFrameHost* render_frame_host_;
|
| + image_downloader::ImageDownloaderPtr downloader_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ImageDownloaderDispatcher);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_IMAGE_DOWNLOADER_DISPATCHER_H_
|
|
|