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

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

Issue 2871303004: Rename TaskRunner::RunsTasksOnCurrentThread() in //chrome (Closed)
Patch Set: fixed build error Created 3 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
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/callback.h" 10 #include "base/callback.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 ImageRequest* image_request; 202 ImageRequest* image_request;
203 { 203 {
204 base::AutoLock lock(map_lock_); 204 base::AutoLock lock(map_lock_);
205 auto it = image_request_id_map_.find(request_id); 205 auto it = image_request_id_map_.find(request_id);
206 if (it == image_request_id_map_.end()) 206 if (it == image_request_id_map_.end())
207 return; 207 return;
208 image_request = it->second; 208 image_request = it->second;
209 image_request_id_map_.erase(it); 209 image_request_id_map_.erase(it);
210 } 210 }
211 211
212 DCHECK(image_request->task_runner()->RunsTasksOnCurrentThread()); 212 DCHECK(image_request->task_runner()->RunsTasksInCurrentSequence());
213 image_request->OnImageDecoded(decoded_image); 213 image_request->OnImageDecoded(decoded_image);
214 } 214 }
215 215
216 void ImageDecoder::OnDecodeImageFailed(int request_id) { 216 void ImageDecoder::OnDecodeImageFailed(int request_id) {
217 ImageRequest* image_request; 217 ImageRequest* image_request;
218 { 218 {
219 base::AutoLock lock(map_lock_); 219 base::AutoLock lock(map_lock_);
220 auto it = image_request_id_map_.find(request_id); 220 auto it = image_request_id_map_.find(request_id);
221 if (it == image_request_id_map_.end()) 221 if (it == image_request_id_map_.end())
222 return; 222 return;
223 image_request = it->second; 223 image_request = it->second;
224 image_request_id_map_.erase(it); 224 image_request_id_map_.erase(it);
225 } 225 }
226 226
227 DCHECK(image_request->task_runner()->RunsTasksOnCurrentThread()); 227 DCHECK(image_request->task_runner()->RunsTasksInCurrentSequence());
228 image_request->OnDecodeImageFailed(); 228 image_request->OnDecodeImageFailed();
229 } 229 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/media_galleries/fileapi/native_media_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698