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

Unified Diff: chrome/plugin/plugin_channel.cc

Issue 164157: Delay releasing plugin process for 10s. (Closed)
Patch Set: prefer constant over magic number Created 11 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/plugin/plugin_channel.cc
diff --git a/chrome/plugin/plugin_channel.cc b/chrome/plugin/plugin_channel.cc
index 7f6f7d6be981cf85daa9c3721d04f11514d0a28d..7234e16c2cb87dc92ef75db14d4837b640539b67 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;
jam 2009/08/07 23:33:26 nit: the convention is to use "Ms"
+
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698