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

Side by Side Diff: chrome/browser/chromeos/login/user_image_loader.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/login/user_image_loader.h" 5 #include "chrome/browser/chromeos/login/user_image_loader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const LoadedCallback& loaded_cb) { 44 const LoadedCallback& loaded_cb) {
45 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); 45 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
46 SequenceToken sequence_token = pool->GetSequenceToken(); 46 SequenceToken sequence_token = pool->GetSequenceToken();
47 Start(filepath, size, sequence_token, loaded_cb); 47 Start(filepath, size, sequence_token, loaded_cb);
48 } 48 }
49 49
50 void UserImageLoader::Start(const std::string& filepath, 50 void UserImageLoader::Start(const std::string& filepath,
51 int size, 51 int size,
52 const SequenceToken& token, 52 const SequenceToken& token,
53 const LoadedCallback& loaded_cb) { 53 const LoadedCallback& loaded_cb) {
54 target_message_loop_ = MessageLoop::current(); 54 target_message_loop_ = base::MessageLoop::current();
55 55
56 ImageInfo image_info(size, loaded_cb); 56 ImageInfo image_info(size, loaded_cb);
57 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); 57 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
58 scoped_refptr<base::SequencedTaskRunner> task_runner = pool-> 58 scoped_refptr<base::SequencedTaskRunner> task_runner = pool->
59 GetSequencedTaskRunnerWithShutdownBehavior(token, 59 GetSequencedTaskRunnerWithShutdownBehavior(token,
60 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); 60 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
61 task_runner->PostTask( 61 task_runner->PostTask(
62 FROM_HERE, 62 FROM_HERE,
63 base::Bind(&UserImageLoader::LoadImage, this, filepath, image_info, 63 base::Bind(&UserImageLoader::LoadImage, this, filepath, image_info,
64 task_runner)); 64 task_runner));
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 new ImageInfo(info_it->second.size, info_it->second.loaded_cb)); 146 new ImageInfo(info_it->second.size, info_it->second.loaded_cb));
147 image_info_map_.erase(decoder); 147 image_info_map_.erase(decoder);
148 } 148 }
149 149
150 target_message_loop_->PostTask( 150 target_message_loop_->PostTask(
151 FROM_HERE, 151 FROM_HERE,
152 base::Bind(image_info->loaded_cb, UserImage())); 152 base::Bind(image_info->loaded_cb, UserImage()));
153 } 153 }
154 154
155 } // namespace chromeos 155 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user_flow.cc ('k') | chrome/browser/chromeos/login/user_image_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698