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

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

Issue 9235052: Fix race condition in utility process clients (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to ToT Created 8 years, 11 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/external_process_importer_client.cc
diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc
index 40dc35f02390280c32cd9ee3095a01b59cdee2ac..55826e388bae9f52c631113b41498a0aa1719ce7 100644
--- a/chrome/browser/importer/external_process_importer_client.cc
+++ b/chrome/browser/importer/external_process_importer_client.cc
@@ -30,7 +30,6 @@ ExternalProcessImporterClient::ExternalProcessImporterClient(
total_history_rows_count_(0),
total_favicons_count_(0),
process_importer_host_(importer_host),
- utility_process_host_(NULL),
source_profile_(source_profile),
items_(items),
bridge_(bridge),
@@ -75,7 +74,8 @@ void ExternalProcessImporterClient::Start() {
void ExternalProcessImporterClient::StartProcessOnIOThread(
BrowserThread::ID thread_id) {
- utility_process_host_ = new UtilityProcessHost(this, thread_id);
+ utility_process_host_ =
+ (new UtilityProcessHost(this, thread_id))->AsWeakPtr();
utility_process_host_->set_no_sandbox(true);
#if defined(OS_MACOSX)
@@ -128,7 +128,6 @@ void ExternalProcessImporterClient::Cancel() {
}
void ExternalProcessImporterClient::OnProcessCrashed(int exit_code) {
- utility_process_host_ = NULL;
if (cancelled_)
return;
« no previous file with comments | « chrome/browser/importer/external_process_importer_client.h ('k') | content/browser/browser_child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698