summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 21:39:48 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-08 21:39:48 +0000
commitb3fbacff42e270eff403fc6d8d6692dd8752c34f (patch)
tree1231fc41923441f60ee3d9164d2a17a29dc3c57d /chrome/browser
parenta2630c16a3f0ad2e2df0779ba6f474bc5317d14b (diff)
downloadchromium_src-b3fbacff42e270eff403fc6d8d6692dd8752c34f.zip
chromium_src-b3fbacff42e270eff403fc6d8d6692dd8752c34f.tar.gz
chromium_src-b3fbacff42e270eff403fc6d8d6692dd8752c34f.tar.bz2
Reenable PluginLoadUnload after fixing a race condition that made it fail in
Release mode. The problem was that we would attempt to restart the plugin process as it was shutting down. BUG=40588 Review URL: http://codereview.chromium.org/1585021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/child_process_host.cc5
-rw-r--r--chrome/browser/child_process_host.h4
-rw-r--r--chrome/browser/extensions/extension_browsertests_misc.cc2
-rw-r--r--chrome/browser/plugin_process_host.cc2
4 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/child_process_host.cc b/chrome/browser/child_process_host.cc
index 727d57c..539670b 100644
--- a/chrome/browser/child_process_host.cc
+++ b/chrome/browser/child_process_host.cc
@@ -312,3 +312,8 @@ ChildProcessHost* ChildProcessHost::Iterator::operator++() {
bool ChildProcessHost::Iterator::Done() {
return iterator_ == Singleton<ChildProcessList>::get()->end();
}
+
+void ChildProcessHost::ForceShutdown() {
+ Singleton<ChildProcessList>::get()->remove(this);
+ Send(new PluginProcessMsg_Shutdown());
+}
diff --git a/chrome/browser/child_process_host.h b/chrome/browser/child_process_host.h
index c7c27be..e735940 100644
--- a/chrome/browser/child_process_host.h
+++ b/chrome/browser/child_process_host.h
@@ -96,6 +96,10 @@ class ChildProcessHost : public ResourceDispatcherHost::Receiver,
// Derived classes return true if it's ok to shut down the child process.
virtual bool CanShutdown() = 0;
+ // Send the shutdown message to the child process, and remove this host from
+ // the host list. Does not check if CanShutdown is true.
+ void ForceShutdown();
+
// Creates the IPC channel. Returns true iff it succeeded.
bool CreateChannel();
diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc
index e45efd5..bea4d81 100644
--- a/chrome/browser/extensions/extension_browsertests_misc.cc
+++ b/chrome/browser/extensions/extension_browsertests_misc.cc
@@ -678,7 +678,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, WindowOpenNoPrivileges) {
#define MAYBE_PluginLoadUnload DISABLED_PluginLoadUnload
#else
// TODO(mpcomplete): http://crbug.com/40588 reenable after fixing.
-#define MAYBE_PluginLoadUnload DISABLED_PluginLoadUnload
+#define MAYBE_PluginLoadUnload PluginLoadUnload
#endif
// Tests that a renderer's plugin list is properly updated when we load and
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index c4669a5..a7aadaa 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -456,7 +456,7 @@ bool PluginProcessHost::Init(const WebPluginInfo& info,
void PluginProcessHost::ForceShutdown() {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO));
Send(new PluginProcessMsg_NotifyRenderersOfPendingShutdown());
- Send(new PluginProcessMsg_Shutdown());
+ ChildProcessHost::ForceShutdown();
}
void PluginProcessHost::OnProcessLaunched() {