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

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

Issue 569623002: Switch ChromeOS Chromium login to use IJG libjpeg (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix copyright and add unit test assertions Created 5 years, 7 months 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 | « chrome/browser/image_decoder.h ('k') | chrome/common/chrome_utility_messages.h » ('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 "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/common/chrome_utility_messages.h" 9 #include "chrome/common/chrome_utility_messages.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 base::Unretained(image_request))); 92 base::Unretained(image_request)));
93 return; 93 return;
94 } 94 }
95 95
96 last_request_ = base::TimeTicks::Now(); 96 last_request_ = base::TimeTicks::Now();
97 base::AutoLock lock(map_lock_); 97 base::AutoLock lock(map_lock_);
98 image_request_id_map_.insert( 98 image_request_id_map_.insert(
99 std::make_pair(image_request_id_counter_, image_request)); 99 std::make_pair(image_request_id_counter_, image_request));
100 100
101 switch (image_codec) { 101 switch (image_codec) {
102 #if defined(OS_CHROMEOS)
102 case ROBUST_JPEG_CODEC: 103 case ROBUST_JPEG_CODEC:
103 utility_process_host_->Send(new ChromeUtilityMsg_RobustJPEGDecodeImage( 104 utility_process_host_->Send(new ChromeUtilityMsg_RobustJPEGDecodeImage(
104 image_data, image_request_id_counter_)); 105 image_data, image_request_id_counter_));
105 break; 106 break;
107 #endif // defined(OS_CHROMEOS)
106 case DEFAULT_CODEC: 108 case DEFAULT_CODEC:
107 utility_process_host_->Send(new ChromeUtilityMsg_DecodeImage( 109 utility_process_host_->Send(new ChromeUtilityMsg_DecodeImage(
108 image_data, shrink_to_fit, image_request_id_counter_)); 110 image_data, shrink_to_fit, image_request_id_counter_));
109 break; 111 break;
110 } 112 }
111 113
112 ++image_request_id_counter_; 114 ++image_request_id_counter_;
113 } 115 }
114 116
115 void ImageDecoder::CancelImpl(ImageRequest* image_request) { 117 void ImageDecoder::CancelImpl(ImageRequest* image_request) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 auto it = image_request_id_map_.find(request_id); 191 auto it = image_request_id_map_.find(request_id);
190 if (it != image_request_id_map_.end()) { 192 if (it != image_request_id_map_.end()) {
191 ImageRequest* image_request = it->second; 193 ImageRequest* image_request = it->second;
192 image_request->task_runner()->PostTask( 194 image_request->task_runner()->PostTask(
193 FROM_HERE, base::Bind(&ImageRequest::OnDecodeImageFailed, 195 FROM_HERE, base::Bind(&ImageRequest::OnDecodeImageFailed,
194 base::Unretained(image_request))); 196 base::Unretained(image_request)));
195 197
196 image_request_id_map_.erase(it); 198 image_request_id_map_.erase(it);
197 } 199 }
198 } 200 }
OLDNEW
« no previous file with comments | « chrome/browser/image_decoder.h ('k') | chrome/common/chrome_utility_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698