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

Unified Diff: content/browser/plugin_loader_posix.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
« no previous file with comments | « content/browser/plugin_loader_posix.h ('k') | content/browser/utility_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_loader_posix.cc
diff --git a/content/browser/plugin_loader_posix.cc b/content/browser/plugin_loader_posix.cc
index 95614ccc420abec472b8e648a05890bf751b94e5..ef4896c0034b6dbc0146c5ab8999faf453556a5d 100644
--- a/content/browser/plugin_loader_posix.cc
+++ b/content/browser/plugin_loader_posix.cc
@@ -17,8 +17,7 @@ using content::BrowserThread;
using content::ChildProcessHost;
PluginLoaderPosix::PluginLoaderPosix()
- : process_host_(NULL),
- next_load_index_(0) {
+ : next_load_index_(0) {
}
void PluginLoaderPosix::LoadPlugins(
@@ -53,7 +52,9 @@ void PluginLoaderPosix::OnProcessCrashed(int exit_code) {
}
bool PluginLoaderPosix::Send(IPC::Message* message) {
- return process_host_->Send(message);
+ if (process_host_)
+ return process_host_->Send(message);
+ return false;
}
PluginLoaderPosix::~PluginLoaderPosix() {
@@ -95,7 +96,8 @@ void PluginLoaderPosix::LoadPluginsInternal() {
if (load_start_time_.is_null())
load_start_time_ = base::TimeTicks::Now();
- process_host_ = new UtilityProcessHost(this, BrowserThread::IO);
+ process_host_ =
+ (new UtilityProcessHost(this, BrowserThread::IO))->AsWeakPtr();
process_host_->set_no_sandbox(true);
#if defined(OS_MACOSX)
process_host_->set_child_flags(ChildProcessHost::CHILD_ALLOW_HEAP_EXECUTION);
« no previous file with comments | « content/browser/plugin_loader_posix.h ('k') | content/browser/utility_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698