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

Unified Diff: chrome/browser/importer/toolbar_importer.cc

Issue 345037: Fifth patch in getting rid of caching MessageLoop pointers. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/importer/toolbar_importer.cc
===================================================================
--- chrome/browser/importer/toolbar_importer.cc (revision 30691)
+++ chrome/browser/importer/toolbar_importer.cc (working copy)
@@ -9,6 +9,7 @@
#include "app/l10n_util.h"
#include "base/string_util.h"
#include "base/rand_util.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/first_run.h"
#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/net/url_request_context_getter.h"
@@ -113,14 +114,12 @@
// If we are conducting network operations, post a message to the importer
// thread for synchronization.
- if (NULL != bridge_->delegate_loop_) {
- if (bridge_->delegate_loop_ != MessageLoop::current()) {
- bridge_->delegate_loop_->PostTask(
- FROM_HERE,
- NewRunnableMethod(this, &Toolbar5Importer::Cancel));
- } else {
- EndImport();
- }
+ if (ChromeThread::CurrentlyOn(ChromeThread::UI)) {
+ EndImport();
+ } else {
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(this, &Toolbar5Importer::Cancel));
}
}

Powered by Google App Engine
This is Rietveld 408576698