Chromium Code Reviews| Index: chrome/browser/image_decoder.h |
| diff --git a/chrome/browser/image_decoder.h b/chrome/browser/image_decoder.h |
| index 2206dd9f454ebcbfc3a29674cf41e1d42eb594ee..fa9e7e10eaeafb47f4059a8c66f82e3767bb94f1 100644 |
| --- a/chrome/browser/image_decoder.h |
| +++ b/chrome/browser/image_decoder.h |
| @@ -12,11 +12,13 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/threading/sequenced_worker_pool.h" |
| #include "content/public/browser/utility_process_host_client.h" |
| +#include "services/image_decoder/public/interfaces/image_decoder.mojom.h" |
| class SkBitmap; |
| // Decodes an image in a sandboxed process. |
| -class ImageDecoder : public content::UtilityProcessHostClient { |
| +class ImageDecoder : public content::UtilityProcessHostClient, |
| + public mojo::ErrorHandler { |
| public: |
| class Delegate { |
| public: |
| @@ -65,6 +67,9 @@ class ImageDecoder : public content::UtilityProcessHostClient { |
| // Overidden from UtilityProcessHostClient: |
| bool OnMessageReceived(const IPC::Message& message) override; |
| + // Overidden from mojo::ErrorHandler: |
| + void OnConnectionError() override; |
| + |
| // IPC message handlers. |
| void OnDecodeImageSucceeded(const SkBitmap& decoded_image); |
| void OnDecodeImageFailed(); |
| @@ -72,11 +77,15 @@ class ImageDecoder : public content::UtilityProcessHostClient { |
| // Launches sandboxed process that will decode the image. |
| void DecodeImageInSandbox(const std::vector<unsigned char>& image_data); |
| + // Mojo RPC callback. |
| + void OnDecodeImageDone(bool success, skia::BitmapPtr image); |
|
sky
2015/04/01 15:00:45
Do we need to distinguish between failure and an e
Anand Mistry (off Chromium)
2015/04/02 04:29:45
Done.
|
| + |
| Delegate* delegate_; |
| std::vector<unsigned char> image_data_; |
| const ImageCodec image_codec_; |
| scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| - bool shrink_to_fit_; // if needed for IPC msg size limit |
| + bool shrink_to_fit_; // if needed for IPC msg size limit |
| + services::ImageDecoderPtr decoder_; |
| DISALLOW_COPY_AND_ASSIGN(ImageDecoder); |
| }; |