summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcmp@google.com <cmp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-07 22:57:06 +0000
committercmp@google.com <cmp@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-07 22:57:06 +0000
commitf137d13a3efdda73cd4a5b62098bda699d94c23b (patch)
treed4ce7fb3141ccb5018d37b7759895c745e2d32e6
parent09e4708c00a932c6d7a8930d05aa84034313f4b2 (diff)
downloadchromium_src-f137d13a3efdda73cd4a5b62098bda699d94c23b.zip
chromium_src-f137d13a3efdda73cd4a5b62098bda699d94c23b.tar.gz
chromium_src-f137d13a3efdda73cd4a5b62098bda699d94c23b.tar.bz2
Delay releasing plugin process for 10s.
Change plugin process release from immediately after we navigate away from our last plugin reference to a task that is run 10s later. Original patch by John Abd-El-Malek (jam@chromium.org). BUG=11341 TEST=Open Chrome, load youtube.com, click Videos, verify all pages load correctly. Review URL: http://codereview.chromium.org/164157 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22818 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/plugin/plugin_channel.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc
index 7f6f7d6..7234e16 100644
--- a/chrome/plugin/plugin_channel.cc
+++ b/chrome/plugin/plugin_channel.cc
@@ -17,6 +17,16 @@
#include "ipc/ipc_channel_posix.h"
#endif
+class PluginReleaseTask : public Task {
+ public:
+ void Run() {
+ ChildProcess::current()->ReleaseProcess();
+ }
+};
+
+// How long we wait before releasing the plugin process.
+static const int kPluginReleaseTimeMS = 10000;
+
PluginChannel* PluginChannel::GetPluginChannel(
int process_id, MessageLoop* ipc_message_loop) {
// map renderer's process id to a (single) channel to that process
@@ -54,7 +64,8 @@ PluginChannel::~PluginChannel() {
close(renderer_fd_);
}
#endif
- ChildProcess::current()->ReleaseProcess();
+ MessageLoop::current()->PostDelayedTask(FROM_HERE, new PluginReleaseTask(),
+ kPluginReleaseTimeMS);
}
bool PluginChannel::Send(IPC::Message* msg) {