OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_IMAGE_DECODER_H_ | 5 #ifndef CHROME_BROWSER_IMAGE_DECODER_H_ |
6 #define CHROME_BROWSER_IMAGE_DECODER_H_ | 6 #define CHROME_BROWSER_IMAGE_DECODER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // the image has been decoded. | 63 // the image has been decoded. |
64 const scoped_refptr<base::SequencedTaskRunner> task_runner_; | 64 const scoped_refptr<base::SequencedTaskRunner> task_runner_; |
65 | 65 |
66 base::SequenceChecker sequence_checker_; | 66 base::SequenceChecker sequence_checker_; |
67 }; | 67 }; |
68 | 68 |
69 enum ImageCodec { | 69 enum ImageCodec { |
70 DEFAULT_CODEC = 0, // Uses WebKit image decoding (via WebImage). | 70 DEFAULT_CODEC = 0, // Uses WebKit image decoding (via WebImage). |
71 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
72 ROBUST_JPEG_CODEC, // Restrict decoding to robust jpeg codec. | 72 ROBUST_JPEG_CODEC, // Restrict decoding to robust jpeg codec. |
| 73 ROBUST_PNG_CODEC, // Restrict decoding to robust PNG codec. |
73 #endif // defined(OS_CHROMEOS) | 74 #endif // defined(OS_CHROMEOS) |
74 }; | 75 }; |
75 | 76 |
76 // Calls StartWithOptions() with ImageCodec::DEFAULT_CODEC and | 77 // Calls StartWithOptions() with ImageCodec::DEFAULT_CODEC and |
77 // shrink_to_fit = false. | 78 // shrink_to_fit = false. |
78 static void Start(ImageRequest* image_request, | 79 static void Start(ImageRequest* image_request, |
79 const std::string& image_data); | 80 const std::string& image_data); |
80 | 81 |
81 // Starts asynchronous image decoding. Once finished, the callback will be | 82 // Starts asynchronous image decoding. Once finished, the callback will be |
82 // posted back to image_request's |task_runner_|. | 83 // posted back to image_request's |task_runner_|. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 base::WeakPtr<content::UtilityProcessHost> utility_process_host_; | 152 base::WeakPtr<content::UtilityProcessHost> utility_process_host_; |
152 | 153 |
153 // Calls StopBatchMode() after |kBatchModeTimeoutSeconds| have elapsed, | 154 // Calls StopBatchMode() after |kBatchModeTimeoutSeconds| have elapsed, |
154 // unless a new decoding request resets the timer. | 155 // unless a new decoding request resets the timer. |
155 scoped_ptr<base::DelayTimer> batch_mode_timer_; | 156 scoped_ptr<base::DelayTimer> batch_mode_timer_; |
156 | 157 |
157 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); | 158 DISALLOW_COPY_AND_ASSIGN(ImageDecoder); |
158 }; | 159 }; |
159 | 160 |
160 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ | 161 #endif // CHROME_BROWSER_IMAGE_DECODER_H_ |
OLD | NEW |