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

Unified Diff: content/browser/indexed_db/idbbindingutilities_browsertest.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: content/browser/indexed_db/idbbindingutilities_browsertest.cc
diff --git a/content/browser/indexed_db/idbbindingutilities_browsertest.cc b/content/browser/indexed_db/idbbindingutilities_browsertest.cc
index b47645faca5742fe650dfeb00dd5b2704ac16ccc..62aed97a1b40f4fa5fe445d7c854b377142b4084 100644
--- a/content/browser/indexed_db/idbbindingutilities_browsertest.cc
+++ b/content/browser/indexed_db/idbbindingutilities_browsertest.cc
@@ -108,7 +108,6 @@ class IDBKeyPathHelper : public UtilityProcessHost::Client {
public:
IDBKeyPathHelper()
: expected_id_(0),
- utility_process_host_(NULL),
value_for_key_path_failed_(false) {
}
@@ -121,7 +120,7 @@ class IDBKeyPathHelper : public UtilityProcessHost::Client {
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
utility_process_host_ =
- new UtilityProcessHost(this, BrowserThread::IO);
+ (new UtilityProcessHost(this, BrowserThread::IO))->AsWeakPtr();
utility_process_host_->set_use_linux_zygote(true);
utility_process_host_->StartBatchMode();
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
@@ -137,7 +136,7 @@ class IDBKeyPathHelper : public UtilityProcessHost::Client {
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
utility_process_host_->EndBatchMode();
- utility_process_host_ = NULL;
+ utility_process_host_.reset();
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
MessageLoop::QuitClosure());
}
@@ -239,7 +238,7 @@ class IDBKeyPathHelper : public UtilityProcessHost::Client {
private:
int expected_id_;
std::vector<IndexedDBKey> expected_keys_;
- UtilityProcessHost* utility_process_host_;
+ base::WeakPtr<UtilityProcessHost> utility_process_host_;
bool value_for_key_path_failed_;
content::SerializedScriptValue expected_value_;
};
« no previous file with comments | « content/browser/in_process_webkit/indexed_db_key_utility_client.cc ('k') | content/browser/plugin_loader_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698