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

Unified Diff: chrome/profile_import/profile_import_thread.cc

Issue 3814019: Switch to using scoped_refptr in chrome/profile_import (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: 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
« no previous file with comments | « chrome/profile_import/profile_import_thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/profile_import/profile_import_thread.cc
diff --git a/chrome/profile_import/profile_import_thread.cc b/chrome/profile_import/profile_import_thread.cc
index dce3c628617dc46581be4f3925e896dba142b57c..57008235e84a21ece67035d78637a39e534f6866 100644
--- a/chrome/profile_import/profile_import_thread.cc
+++ b/chrome/profile_import/profile_import_thread.cc
@@ -51,7 +51,6 @@ void ProfileImportThread::OnImportStart(
const DictionaryValue& localized_strings,
bool import_to_bookmark_bar) {
bridge_ = new ExternalProcessImporterBridge(this, localized_strings);
- bridge_->AddRef(); // Balanced in Cleanup().
ImporterList importer_list;
importer_ = importer_list.CreateImporterByType(profile_info.browser_type);
@@ -61,7 +60,6 @@ void ProfileImportThread::OnImportStart(
return;
}
- importer_->AddRef(); // Balanced in Cleanup().
importer_->set_import_to_bookmark_bar(import_to_bookmark_bar);
items_to_import_ = items;
@@ -73,9 +71,14 @@ void ProfileImportThread::OnImportStart(
NOTREACHED();
Cleanup();
}
- import_thread_->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(importer_, &Importer::StartImport,
- profile_info, items, bridge_));
+ import_thread_->message_loop()->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(
+ importer_.get(),
+ &Importer::StartImport,
+ profile_info,
+ items,
+ bridge_));
}
void ProfileImportThread::OnImportCancel() {
@@ -186,7 +189,7 @@ void ProfileImportThread::NotifyKeywordsReady(
void ProfileImportThread::Cleanup() {
importer_->Cancel();
- importer_->Release();
- bridge_->Release();
+ importer_ = NULL;
+ bridge_ = NULL;
ChildProcess::current()->ReleaseProcess();
}
« no previous file with comments | « chrome/profile_import/profile_import_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698