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

Unified Diff: content/ppapi_plugin/broker_process_dispatcher.cc

Issue 8879003: Remove custom Task implementations from content/ppapi_plugin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 | content/ppapi_plugin/plugin_process_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/broker_process_dispatcher.cc
diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc
index 26a71007769c251099a2a35c68f99359f2a1909b..6fce803b636ff897ad308540d027b54622b50a02 100644
--- a/content/ppapi_plugin/broker_process_dispatcher.cc
+++ b/content/ppapi_plugin/broker_process_dispatcher.cc
@@ -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);
}
« no previous file with comments | « no previous file | content/ppapi_plugin/plugin_process_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698