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

Unified Diff: webkit/dom_storage/dom_storage_task_runner.h

Issue 9689033: Derive DomStorageTaskRunner from base::TaskRunner now that it exists. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | webkit/dom_storage/dom_storage_task_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/dom_storage_task_runner.h
===================================================================
--- webkit/dom_storage/dom_storage_task_runner.h (revision 126267)
+++ webkit/dom_storage/dom_storage_task_runner.h (working copy)
@@ -6,6 +6,7 @@
#define WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_
#pragma once
+#include "base/task_runner.h"
#include "base/memory/ref_counted.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/time.h"
@@ -18,17 +19,14 @@
// Tasks must run serially with respect to one another, but may
// execute on different OS threads. The base class is implemented
-// in terms of a MessageLoopProxy for use in testing.
-class DomStorageTaskRunner
- : public base::RefCountedThreadSafe<DomStorageTaskRunner> {
+// in terms of a MessageLoopProxy.
+class DomStorageTaskRunner : public base::TaskRunner {
public:
explicit DomStorageTaskRunner(base::MessageLoopProxy* message_loop);
virtual ~DomStorageTaskRunner();
- // Schedules a task to be run immediately.
- virtual bool PostTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task);
+ // The PostTask() method, defined by TaskRunner, Schedules a task
+ // to run immediately.
// Schedules a task to be run after a delay.
virtual bool PostDelayedTask(
@@ -36,6 +34,17 @@
const base::Closure& task,
base::TimeDelta delay);
+ // DEPRECATED: Only here because base::TaskRunner requires it, implemented
+ // by calling the virtual PostDelayedTask(..., TimeDelta) variant.
benm (inactive) 2012/03/13 11:09:56 Why not just use this delay_ms variant and lose th
+ virtual bool PostDelayedTask(
+ const tracked_objects::Location& from_here,
+ const base::Closure& task,
+ int64 delay_ms);
+
+ // Only here because base::TaskRunner requires it, the return
+ // value is hard coded to true.
+ virtual bool RunsTasksOnCurrentThread() const;
+
protected:
const scoped_refptr<base::MessageLoopProxy> message_loop_;
};
@@ -47,20 +56,18 @@
public:
DomStorageWorkerPoolTaskRunner(
base::SequencedWorkerPool* sequenced_worker_pool,
+ base::SequencedWorkerPool::SequenceToken sequence_token,
base::MessageLoopProxy* delayed_task_loop);
virtual ~DomStorageWorkerPoolTaskRunner();
- // Schedules a sequenced worker task to be run immediately.
- virtual bool PostTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task) OVERRIDE;
-
// Schedules a sequenced worker task to be run after a delay.
virtual bool PostDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
base::TimeDelta delay) OVERRIDE;
+ base::SequencedWorkerPool::SequenceToken sequence_token() const;
+
private:
const scoped_refptr<base::SequencedWorkerPool> sequenced_worker_pool_;
base::SequencedWorkerPool::SequenceToken sequence_token_;
@@ -72,7 +79,7 @@
class MockDomStorageTaskRunner : public DomStorageTaskRunner {
public:
explicit MockDomStorageTaskRunner(base::MessageLoopProxy* message_loop);
- virtual ~MockDomStorageTaskRunner() { }
+ virtual ~MockDomStorageTaskRunner() {}
virtual bool PostDelayedTask(
const tracked_objects::Location& from_here,
« no previous file with comments | « no previous file | webkit/dom_storage/dom_storage_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698