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

Unified Diff: chrome/browser/user_data_manager.cc

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/user_data_manager.cc
===================================================================
--- chrome/browser/user_data_manager.cc (revision 30037)
+++ chrome/browser/user_data_manager.cc (working copy)
@@ -210,8 +210,7 @@
void UserDataManager::GetProfiles(std::vector<std::wstring>* profiles) const {
// This function should be called on the file thread.
- DCHECK(MessageLoop::current() ==
- ChromeThread::GetMessageLoop(ChromeThread::FILE));
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
file_util::FileEnumerator file_enum(
FilePath::FromWStringHack(user_data_root_),
false, file_util::FileEnumerator::DIRECTORIES);
@@ -281,9 +280,8 @@
message_loop_ = MessageLoop::current();
}
DCHECK(message_loop_);
- MessageLoop* file_loop = ChromeThread::GetMessageLoop(ChromeThread::FILE);
- file_loop->PostTask(
- FROM_HERE,
+ ChromeThread::PostTask(
+ ChromeThread::FILE, FROM_HERE,
NewRunnableMethod(this, &GetProfilesHelper::GetProfilesFromManager));
}
@@ -294,8 +292,7 @@
void GetProfilesHelper::GetProfilesFromManager() {
// This function should be called on the file thread.
- DCHECK(MessageLoop::current() ==
- ChromeThread::GetMessageLoop(ChromeThread::FILE));
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
// If the delegate is gone by now, no need to do any work.
if (!delegate_)

Powered by Google App Engine
This is Rietveld 408576698