Commit 0d70be69 authored by dcheng@chromium.org's avatar dcheng@chromium.org

Remove custom Task implementations from content/ppapi_plugin

BUG=none
TEST=none


Review URL: http://codereview.chromium.org/8879003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113555 0039d316-1c4b-4281-b951-d872f2087c98
parent f3ed502b
......@@ -4,18 +4,12 @@
#include "content/ppapi_plugin/broker_process_dispatcher.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "content/common/child_process.h"
namespace {
class BrokerReleaseTask : public Task {
public:
void Run() {
DVLOG(1) << "BrokerReleaseTask::Run()";
ChildProcess::current()->ReleaseProcess();
}
};
// How long we wait before releasing the broker process.
const int kBrokerReleaseTimeMs = 30 * 1000; // 30 seconds.
......@@ -36,6 +30,9 @@ BrokerProcessDispatcher::~BrokerProcessDispatcher() {
// 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 BrokerReleaseTask(),
kBrokerReleaseTimeMs);
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&ChildProcess::ReleaseProcess,
base::Unretained(ChildProcess::current())),
kBrokerReleaseTimeMs);
}
......@@ -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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment