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 #include "chrome/browser/image_decoder.h" | 5 #include "chrome/browser/image_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/thread_task_runner_handle.h" | 8 #include "base/thread_task_runner_handle.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 &ImageDecoder::StopBatchMode)); | 131 &ImageDecoder::StopBatchMode)); |
132 } | 132 } |
133 batch_mode_timer_->Reset(); | 133 batch_mode_timer_->Reset(); |
134 | 134 |
135 switch (image_codec) { | 135 switch (image_codec) { |
136 #if defined(OS_CHROMEOS) | 136 #if defined(OS_CHROMEOS) |
137 case ROBUST_JPEG_CODEC: | 137 case ROBUST_JPEG_CODEC: |
138 utility_process_host_->Send(new ChromeUtilityMsg_RobustJPEGDecodeImage( | 138 utility_process_host_->Send(new ChromeUtilityMsg_RobustJPEGDecodeImage( |
139 image_data, request_id)); | 139 image_data, request_id)); |
140 break; | 140 break; |
| 141 case ROBUST_PNG_CODEC: |
| 142 utility_process_host_->Send(new ChromeUtilityMsg_RobustPNGDecodeImage( |
| 143 image_data, request_id)); |
| 144 break; |
141 #endif // defined(OS_CHROMEOS) | 145 #endif // defined(OS_CHROMEOS) |
142 case DEFAULT_CODEC: | 146 case DEFAULT_CODEC: |
143 utility_process_host_->Send(new ChromeUtilityMsg_DecodeImage( | 147 utility_process_host_->Send(new ChromeUtilityMsg_DecodeImage( |
144 image_data, shrink_to_fit, request_id)); | 148 image_data, shrink_to_fit, request_id)); |
145 break; | 149 break; |
146 } | 150 } |
147 } | 151 } |
148 | 152 |
149 void ImageDecoder::CancelImpl(ImageRequest* image_request) { | 153 void ImageDecoder::CancelImpl(ImageRequest* image_request) { |
150 base::AutoLock lock(map_lock_); | 154 base::AutoLock lock(map_lock_); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 auto it = image_request_id_map_.find(request_id); | 286 auto it = image_request_id_map_.find(request_id); |
283 if (it == image_request_id_map_.end()) | 287 if (it == image_request_id_map_.end()) |
284 return; | 288 return; |
285 image_request = it->second; | 289 image_request = it->second; |
286 image_request_id_map_.erase(it); | 290 image_request_id_map_.erase(it); |
287 } | 291 } |
288 | 292 |
289 DCHECK(image_request->task_runner()->RunsTasksOnCurrentThread()); | 293 DCHECK(image_request->task_runner()->RunsTasksOnCurrentThread()); |
290 image_request->OnDecodeImageFailed(); | 294 image_request->OnDecodeImageFailed(); |
291 } | 295 } |
OLD | NEW |