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

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

Issue 3581008: Fix instances of passing raw pointers to RefCounted objects in tasks. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge Created 10 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/importer/importer_unittest.cc
diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc
index 879d7cbc89135caf59c8268a6509a58973023d7b..d99b1e925997d715685377c60709030728b96339 100644
--- a/chrome/browser/importer/importer_unittest.cc
+++ b/chrome/browser/importer/importer_unittest.cc
@@ -120,9 +120,15 @@ class ImporterTest : public testing::Test {
int items = HISTORY | PASSWORDS | FAVORITES;
if (import_search_plugins)
items = items | SEARCH_ENGINES;
- loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(),
- &ImporterHost::StartImportSettings, profile_info,
- static_cast<Profile*>(NULL), items, writer, true));
+ loop->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(host.get(),
+ &ImporterHost::StartImportSettings,
+ profile_info,
+ static_cast<Profile*>(NULL),
+ items,
+ make_scoped_refptr(writer),
+ true));
loop->Run();
}
@@ -698,17 +704,23 @@ TEST_F(ImporterTest, MAYBE(Firefox2Importer)) {
MessageLoop* loop = MessageLoop::current();
scoped_refptr<ImporterHost> host = new ImporterHost();
- FirefoxObserver* observer = new FirefoxObserver();
+ scoped_refptr<FirefoxObserver> observer = new FirefoxObserver();
host->SetObserver(observer);
ProfileInfo profile_info;
profile_info.browser_type = FIREFOX2;
profile_info.app_path = app_path_;
profile_info.source_path = profile_path_;
- loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(),
- &ImporterHost::StartImportSettings, profile_info,
- static_cast<Profile*>(NULL),
- HISTORY | PASSWORDS | FAVORITES | SEARCH_ENGINES, observer, true));
+ loop->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(
+ host.get(),
+ &ImporterHost::StartImportSettings,
+ profile_info,
+ static_cast<Profile*>(NULL),
+ HISTORY | PASSWORDS | FAVORITES | SEARCH_ENGINES,
+ observer,
+ true));
loop->Run();
}
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698