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

Unified Diff: extensions/common/one_shot_event.cc

Issue 1120793007: [extensions] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Dependency over component module by removing file Created 5 years, 7 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 | « extensions/common/one_shot_event.h ('k') | extensions/common/one_shot_event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/one_shot_event.cc
diff --git a/extensions/common/one_shot_event.cc b/extensions/common/one_shot_event.cc
index ebba0d1823000dfca59cca791446661df8ee5054..a5a4ddc120d028acee22edb95100f48277eb85c7 100644
--- a/extensions/common/one_shot_event.cc
+++ b/extensions/common/one_shot_event.cc
@@ -7,25 +7,26 @@
#include "base/callback.h"
#include "base/lazy_instance.h"
#include "base/location.h"
-#include "base/message_loop/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
#include "base/task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
-using base::TaskRunner;
+using base::SingleThreadTaskRunner;
namespace extensions {
struct OneShotEvent::TaskInfo {
TaskInfo() {}
TaskInfo(const tracked_objects::Location& from_here,
- const scoped_refptr<TaskRunner>& runner,
+ const scoped_refptr<SingleThreadTaskRunner>& runner,
const base::Closure& task,
const base::TimeDelta& delay)
: from_here(from_here), runner(runner), task(task), delay(delay) {
CHECK(runner.get()); // Detect mistakes with a decent stack frame.
}
tracked_objects::Location from_here;
- scoped_refptr<TaskRunner> runner;
+ scoped_refptr<SingleThreadTaskRunner> runner;
base::Closure task;
base::TimeDelta delay;
};
@@ -42,20 +43,21 @@ OneShotEvent::~OneShotEvent() {}
void OneShotEvent::Post(const tracked_objects::Location& from_here,
const base::Closure& task) const {
- PostImpl(
- from_here, task, base::MessageLoopProxy::current(), base::TimeDelta());
+ PostImpl(from_here, task, base::ThreadTaskRunnerHandle::Get(),
+ base::TimeDelta());
}
-void OneShotEvent::Post(const tracked_objects::Location& from_here,
- const base::Closure& task,
- const scoped_refptr<TaskRunner>& runner) const {
+void OneShotEvent::Post(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ const scoped_refptr<SingleThreadTaskRunner>& runner) const {
PostImpl(from_here, task, runner, base::TimeDelta());
}
void OneShotEvent::PostDelayed(const tracked_objects::Location& from_here,
const base::Closure& task,
const base::TimeDelta& delay) const {
- PostImpl(from_here, task, base::MessageLoopProxy::current(), delay);
+ PostImpl(from_here, task, base::ThreadTaskRunnerHandle::Get(), delay);
}
void OneShotEvent::Signal() {
@@ -81,7 +83,7 @@ void OneShotEvent::Signal() {
void OneShotEvent::PostImpl(const tracked_objects::Location& from_here,
const base::Closure& task,
- const scoped_refptr<TaskRunner>& runner,
+ const scoped_refptr<SingleThreadTaskRunner>& runner,
const base::TimeDelta& delay) const {
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « extensions/common/one_shot_event.h ('k') | extensions/common/one_shot_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698