OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 IOS_WEB_PUBLIC_IMAGE_FETCHER_WEBP_DECODER_H_ | 5 #ifndef IOS_WEB_PUBLIC_IMAGE_FETCHER_WEBP_DECODER_H_ |
6 #define IOS_WEB_PUBLIC_IMAGE_FETCHER_WEBP_DECODER_H_ | 6 #define IOS_WEB_PUBLIC_IMAGE_FETCHER_WEBP_DECODER_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 friend class base::RefCountedThreadSafe<WebpDecoder::Delegate>; | 37 friend class base::RefCountedThreadSafe<WebpDecoder::Delegate>; |
38 virtual ~Delegate() {} | 38 virtual ~Delegate() {} |
39 }; | 39 }; |
40 | 40 |
41 explicit WebpDecoder(WebpDecoder::Delegate* delegate); | 41 explicit WebpDecoder(WebpDecoder::Delegate* delegate); |
42 | 42 |
43 // For tests. | 43 // For tests. |
44 static size_t GetHeaderSize(); | 44 static size_t GetHeaderSize(); |
45 | 45 |
46 // Main entry point. | 46 // Main entry point. |
47 void OnDataReceived(const base::scoped_nsobject<NSData>& data); | 47 void OnDataReceived(NSData* data); |
48 | 48 |
49 // Stops the decoding. | 49 // Stops the decoding. |
50 void Stop(); | 50 void Stop(); |
51 | 51 |
52 private: | 52 private: |
53 struct WebPIDecoderDeleter { | 53 struct WebPIDecoderDeleter { |
54 inline void operator()(WebPIDecoder* ptr) const { WebPIDelete(ptr); } | 54 inline void operator()(WebPIDecoder* ptr) const { WebPIDelete(ptr); } |
55 }; | 55 }; |
56 | 56 |
57 enum State { READING_FEATURES, READING_DATA, DONE }; | 57 enum State { READING_FEATURES, READING_DATA, DONE }; |
(...skipping 11 matching lines...) Expand all Loading... |
69 WebpDecoder::State state_; | 69 WebpDecoder::State state_; |
70 std::unique_ptr<WebPIDecoder, WebPIDecoderDeleter> incremental_decoder_; | 70 std::unique_ptr<WebPIDecoder, WebPIDecoderDeleter> incremental_decoder_; |
71 base::scoped_nsobject<NSData> output_buffer_; | 71 base::scoped_nsobject<NSData> output_buffer_; |
72 base::scoped_nsobject<NSMutableData> features_; | 72 base::scoped_nsobject<NSMutableData> features_; |
73 int has_alpha_; | 73 int has_alpha_; |
74 }; | 74 }; |
75 | 75 |
76 } // namespace webp_transcode | 76 } // namespace webp_transcode |
77 | 77 |
78 #endif // IOS_WEB_PUBLIC_IMAGE_FETCHER_WEBP_DECODER_H_ | 78 #endif // IOS_WEB_PUBLIC_IMAGE_FETCHER_WEBP_DECODER_H_ |
OLD | NEW |