Index: content/ppapi_plugin/plugin_process_dispatcher.cc |
diff --git a/content/ppapi_plugin/plugin_process_dispatcher.cc b/content/ppapi_plugin/plugin_process_dispatcher.cc |
index 0243100ede23def13d11cd8f56026e4ff82c9157..1ac23d14795e783679d3ffc559d74fe5d0252411 100644 |
--- a/content/ppapi_plugin/plugin_process_dispatcher.cc |
+++ b/content/ppapi_plugin/plugin_process_dispatcher.cc |
@@ -4,17 +4,12 @@ |
#include "content/ppapi_plugin/plugin_process_dispatcher.h" |
+#include "base/bind.h" |
+#include "base/bind_helpers.h" |
#include "content/common/child_process.h" |
namespace { |
-class PluginReleaseTask : public Task { |
- public: |
- void Run() { |
- ChildProcess::current()->ReleaseProcess(); |
- } |
-}; |
- |
// How long we wait before releasing the plugin process. |
const int kPluginReleaseTimeMs = 30 * 1000; // 30 seconds. |
@@ -33,6 +28,9 @@ PluginProcessDispatcher::~PluginProcessDispatcher() { |
// plugin. This is the case for common plugins where they may be used on a |
// source and destination page of a navigation. We don't want to tear down |
// and re-start processes each time in these cases. |
- MessageLoop::current()->PostDelayedTask(FROM_HERE, new PluginReleaseTask(), |
- kPluginReleaseTimeMs); |
+ MessageLoop::current()->PostDelayedTask( |
+ FROM_HERE, |
+ base::Bind(&ChildProcess::ReleaseProcess, |
+ base::Unretained(ChildProcess::current())), |
+ kPluginReleaseTimeMs); |
} |