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 CHROME_UTILITY_IMAGE_DECODER_IMPL_H_ | 5 #ifndef CHROME_UTILITY_IMAGE_DECODER_IMPL_H_ |
6 #define CHROME_UTILITY_IMAGE_DECODER_IMPL_H_ | 6 #define CHROME_UTILITY_IMAGE_DECODER_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/common/image_decoder.mojom.h" | 9 #include "chrome/common/image_decoder.mojom.h" |
10 #include "mojo/public/cpp/bindings/strong_binding.h" | 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
11 | 11 |
12 class ImageDecoderImpl : public mojom::ImageDecoder { | 12 class ImageDecoderImpl : public mojom::ImageDecoder { |
13 public: | 13 public: |
14 explicit ImageDecoderImpl(int64_t max_message_size); | 14 explicit ImageDecoderImpl(int64_t max_message_size); |
15 explicit ImageDecoderImpl( | 15 explicit ImageDecoderImpl( |
16 mojo::InterfaceRequest<mojom::ImageDecoder> request); | 16 mojo::InterfaceRequest<mojom::ImageDecoder> request); |
17 ~ImageDecoderImpl() override; | 17 ~ImageDecoderImpl() override; |
18 | 18 |
19 // Overridden from mojom::ImageDecoder: | 19 // Overridden from mojom::ImageDecoder: |
20 void DecodeImage( | 20 void DecodeImage( |
21 mojo::Array<uint8_t> encoded_data, | 21 mojo::Array<uint8_t> encoded_data, |
22 mojom::ImageCodec codec, | 22 mojom::ImageCodec codec, |
23 bool shrink_to_fit, | 23 bool shrink_to_fit, |
24 const mojo::Callback<void(skia::mojom::BitmapPtr)>& callback) override; | 24 const mojo::Callback<void(const SkBitmap&)>& callback) override; |
25 | 25 |
26 private: | 26 private: |
27 int64_t max_message_size_; | 27 int64_t max_message_size_; |
28 mojo::StrongBinding<ImageDecoder> binding_; | 28 mojo::StrongBinding<ImageDecoder> binding_; |
29 | 29 |
30 DISALLOW_COPY_AND_ASSIGN(ImageDecoderImpl); | 30 DISALLOW_COPY_AND_ASSIGN(ImageDecoderImpl); |
31 }; | 31 }; |
32 | 32 |
33 #endif // CHROME_UTILITY_IMAGE_DECODER_IMPL_H_ | 33 #endif // CHROME_UTILITY_IMAGE_DECODER_IMPL_H_ |
OLD | NEW |