| Index: webkit/dom_storage/dom_storage_task_runner.h
|
| ===================================================================
|
| --- webkit/dom_storage/dom_storage_task_runner.h (revision 127221)
|
| +++ webkit/dom_storage/dom_storage_task_runner.h (working copy)
|
| @@ -18,11 +18,9 @@
|
| namespace dom_storage {
|
|
|
| // 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.
|
| +// execute on different OS threads.
|
| class DomStorageTaskRunner : public base::SequencedTaskRunner {
|
| public:
|
| - explicit DomStorageTaskRunner(base::MessageLoopProxy* message_loop);
|
| virtual ~DomStorageTaskRunner();
|
|
|
| // The PostTask() method, defined by TaskRunner, schedules a task
|
| @@ -56,12 +54,22 @@
|
| const base::Closure& task,
|
| int64 delay_ms) OVERRIDE;
|
|
|
| + virtual bool PostShutdownBlockingTask(
|
| + const tracked_objects::Location& from_here,
|
| + const base::Closure& task) = 0;
|
| +
|
| + virtual bool PostShutdownBlockingCommitTask(
|
| + const tracked_objects::Location& from_here,
|
| + const base::Closure& task) = 0;
|
| +
|
| protected:
|
| + explicit DomStorageTaskRunner(base::MessageLoopProxy* message_loop);
|
| +
|
| const scoped_refptr<base::MessageLoopProxy> message_loop_;
|
| };
|
|
|
| // A derived class that utlizes the SequenceWorkerPool under a
|
| -// dom_storage specific SequenceToken. The MessageLoopProxy
|
| +// dom_storage specific SequenceTokens. The MessageLoopProxy
|
| // is used to delay scheduling on the worker pool.
|
| class DomStorageWorkerPoolTaskRunner : public DomStorageTaskRunner {
|
| public:
|
| @@ -79,9 +87,18 @@
|
|
|
| base::SequencedWorkerPool::SequenceToken sequence_token() const;
|
|
|
| + virtual bool PostShutdownBlockingTask(
|
| + const tracked_objects::Location& from_here,
|
| + const base::Closure& task) OVERRIDE;
|
| +
|
| + virtual bool PostShutdownBlockingCommitTask(
|
| + const tracked_objects::Location& from_here,
|
| + const base::Closure& task) OVERRIDE;
|
| +
|
| private:
|
| const scoped_refptr<base::SequencedWorkerPool> sequenced_worker_pool_;
|
| base::SequencedWorkerPool::SequenceToken sequence_token_;
|
| + base::SequencedWorkerPool::SequenceToken commit_sequence_token_;
|
| };
|
|
|
| // A derived class used in unit tests that causes us to ignore the
|
| @@ -96,6 +113,14 @@
|
| const tracked_objects::Location& from_here,
|
| const base::Closure& task,
|
| base::TimeDelta delay) OVERRIDE;
|
| +
|
| + virtual bool PostShutdownBlockingTask(
|
| + const tracked_objects::Location& from_here,
|
| + const base::Closure& task) OVERRIDE;
|
| +
|
| + virtual bool PostShutdownBlockingCommitTask(
|
| + const tracked_objects::Location& from_here,
|
| + const base::Closure& task) OVERRIDE;
|
| };
|
|
|
| } // namespace dom_storage
|
|
|