| 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);
|
|
|