diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-19 19:03:36 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-19 19:03:36 +0000 |
commit | f70bb327c10caf701046527405f5417dbfe54443 (patch) | |
tree | ee636f10a834e7c30d445775f0aa18d847b2dd1f | |
parent | 0dfa9a181d79451e58b1c157cd74cb47f4494bc9 (diff) | |
download | chromium_src-f70bb327c10caf701046527405f5417dbfe54443.zip chromium_src-f70bb327c10caf701046527405f5417dbfe54443.tar.gz chromium_src-f70bb327c10caf701046527405f5417dbfe54443.tar.bz2 |
Switch to using scoped_refptr in chrome/profile_import
BUG=28083
TEST=builds
Review URL: http://codereview.chromium.org/3814019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63079 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/profile_import/profile_import_thread.cc | 17 | ||||
-rw-r--r-- | chrome/profile_import/profile_import_thread.h | 4 |
2 files changed, 12 insertions, 9 deletions
diff --git a/chrome/profile_import/profile_import_thread.cc b/chrome/profile_import/profile_import_thread.cc index dce3c62..5700823 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(); } diff --git a/chrome/profile_import/profile_import_thread.h b/chrome/profile_import/profile_import_thread.h index e3335bc..079fa4c 100644 --- a/chrome/profile_import/profile_import_thread.h +++ b/chrome/profile_import/profile_import_thread.h @@ -84,7 +84,7 @@ class ProfileImportThread : public ChildThread { // Bridge object is passed to importer, so that it can send IPC calls // directly back to the ProfileImportProcessHost. - ExternalProcessImporterBridge* bridge_; + scoped_refptr<ExternalProcessImporterBridge> bridge_; // importer::ProfileType enum from importer_list, stored in ProfileInfo // struct in importer. @@ -94,7 +94,7 @@ class ProfileImportThread : public ChildThread { uint16 items_to_import_; // Importer of the appropriate type (Firefox, Safari, IE, etc.) - Importer* importer_; + scoped_refptr<Importer> importer_; DISALLOW_COPY_AND_ASSIGN(ProfileImportThread); }; |