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

Unified Diff: chrome/browser/importer/importer_bridge.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/importer_bridge.cc
===================================================================
--- chrome/browser/importer/importer_bridge.cc (revision 30691)
+++ chrome/browser/importer/importer_bridge.cc (working copy)
@@ -4,7 +4,7 @@
#include "chrome/browser/importer/importer_bridge.h"
-#include "base/message_loop.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/importer/importer.h"
#if defined(OS_WIN)
#include "chrome/browser/password_manager/ie7_password.h"
@@ -12,78 +12,89 @@
#include "webkit/glue/password_form.h"
InProcessImporterBridge::InProcessImporterBridge(ProfileWriter* writer,
- MessageLoop* delegate_loop,
ImporterHost* host)
- : ImporterBridge(writer, delegate_loop, host),
- main_loop_(MessageLoop::current()),
- delegate_loop_(NULL) {
+ : ImporterBridge(writer, host) {
}
void InProcessImporterBridge::AddBookmarkEntries(
const std::vector<ProfileWriter::BookmarkEntry>& bookmarks,
const std::wstring& first_folder_name,
int options) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_,
- &ProfileWriter::AddBookmarkEntry, bookmarks, first_folder_name,
- options));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(
+ writer_, &ProfileWriter::AddBookmarkEntry, bookmarks,
+ first_folder_name, options));
}
void InProcessImporterBridge::AddHomePage(const GURL &home_page) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_,
- &ProfileWriter::AddHomepage, home_page));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(writer_, &ProfileWriter::AddHomepage, home_page));
}
#if defined(OS_WIN)
void InProcessImporterBridge::AddIE7PasswordInfo(
const IE7PasswordInfo password_info) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_,
- &ProfileWriter::AddIE7PasswordInfo, password_info));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(writer_, &ProfileWriter::AddIE7PasswordInfo,
+ password_info));
}
#endif // OS_WIN
void InProcessImporterBridge::SetFavIcons(
const std::vector<history::ImportedFavIconUsage>& fav_icons) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_,
- &ProfileWriter::AddFavicons, fav_icons));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(writer_, &ProfileWriter::AddFavicons, fav_icons));
}
void InProcessImporterBridge::SetHistoryItems(
const std::vector<history::URLRow> &rows) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_,
- &ProfileWriter::AddHistoryPage, rows));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(writer_, &ProfileWriter::AddHistoryPage, rows));
}
void InProcessImporterBridge::SetKeywords(
const std::vector<TemplateURL*>& template_urls,
int default_keyword_index,
bool unique_on_host_and_path) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_,
- &ProfileWriter::AddKeywords, template_urls, default_keyword_index,
- unique_on_host_and_path));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(
+ writer_, &ProfileWriter::AddKeywords, template_urls,
+ default_keyword_index, unique_on_host_and_path));
}
void InProcessImporterBridge::SetPasswordForm(
const webkit_glue::PasswordForm& form) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(writer_,
- &ProfileWriter::AddPasswordForm, form));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(writer_, &ProfileWriter::AddPasswordForm, form));
}
void InProcessImporterBridge::NotifyItemStarted(ImportItem item) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(host_,
- &ImporterHost::ImportItemStarted, item));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(host_, &ImporterHost::ImportItemStarted, item));
}
void InProcessImporterBridge::NotifyItemEnded(ImportItem item) {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(host_,
- &ImporterHost::ImportItemEnded, item));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(host_, &ImporterHost::ImportItemEnded, item));
}
void InProcessImporterBridge::NotifyStarted() {
- main_loop_->PostTask(FROM_HERE, NewRunnableMethod(host_,
- &ImporterHost::ImportStarted));
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
+ NewRunnableMethod(host_, &ImporterHost::ImportStarted));
}
void InProcessImporterBridge::NotifyEnded() {
- main_loop_->PostTask(FROM_HERE,
+ ChromeThread::PostTask(
+ ChromeThread::UI, FROM_HERE,
NewRunnableMethod(host_, &ImporterHost::ImportEnded));
}
Property changes on: chrome\browser\importer\importer_bridge.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698