Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/image_decoder.cc

Issue 2483013002: Mojo C++ bindings: Remove more use_new_wrapper_types=false. (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 batch_mode_timer_->Reset(); 167 batch_mode_timer_->Reset();
168 168
169 mojom::ImageCodec mojo_codec = mojom::ImageCodec::DEFAULT; 169 mojom::ImageCodec mojo_codec = mojom::ImageCodec::DEFAULT;
170 #if defined(OS_CHROMEOS) 170 #if defined(OS_CHROMEOS)
171 if (image_codec == ROBUST_JPEG_CODEC) 171 if (image_codec == ROBUST_JPEG_CODEC)
172 mojo_codec = mojom::ImageCodec::ROBUST_JPEG; 172 mojo_codec = mojom::ImageCodec::ROBUST_JPEG;
173 if (image_codec == ROBUST_PNG_CODEC) 173 if (image_codec == ROBUST_PNG_CODEC)
174 mojo_codec = mojom::ImageCodec::ROBUST_PNG; 174 mojo_codec = mojom::ImageCodec::ROBUST_PNG;
175 #endif // defined(OS_CHROMEOS) 175 #endif // defined(OS_CHROMEOS)
176 decoder_->DecodeImage( 176 decoder_->DecodeImage(
177 mojo::Array<uint8_t>(std::move(image_data)), 177 image_data, mojo_codec, shrink_to_fit,
178 mojo_codec,
179 shrink_to_fit,
180 base::Bind(&OnDecodeImageDone, 178 base::Bind(&OnDecodeImageDone,
181 base::Bind(&ImageDecoder::OnDecodeImageFailed, this), 179 base::Bind(&ImageDecoder::OnDecodeImageFailed, this),
182 base::Bind(&ImageDecoder::OnDecodeImageSucceeded, this), 180 base::Bind(&ImageDecoder::OnDecodeImageSucceeded, this),
183 request_id)); 181 request_id));
184 } 182 }
185 183
186 void ImageDecoder::CancelImpl(ImageRequest* image_request) { 184 void ImageDecoder::CancelImpl(ImageRequest* image_request) {
187 base::AutoLock lock(map_lock_); 185 base::AutoLock lock(map_lock_);
188 for (auto it = image_request_id_map_.begin(); 186 for (auto it = image_request_id_map_.begin();
189 it != image_request_id_map_.end();) { 187 it != image_request_id_map_.end();) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 auto it = image_request_id_map_.find(request_id); 312 auto it = image_request_id_map_.find(request_id);
315 if (it == image_request_id_map_.end()) 313 if (it == image_request_id_map_.end())
316 return; 314 return;
317 image_request = it->second; 315 image_request = it->second;
318 image_request_id_map_.erase(it); 316 image_request_id_map_.erase(it);
319 } 317 }
320 318
321 DCHECK(image_request->task_runner()->RunsTasksOnCurrentThread()); 319 DCHECK(image_request->task_runner()->RunsTasksOnCurrentThread());
322 image_request->OnDecodeImageFailed(); 320 image_request->OnDecodeImageFailed();
323 } 321 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698