OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ | 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ |
6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 class CONTENT_EXPORT DOMStorageTaskRunner | 29 class CONTENT_EXPORT DOMStorageTaskRunner |
30 : public base::TaskRunner { | 30 : public base::TaskRunner { |
31 public: | 31 public: |
32 enum SequenceID { | 32 enum SequenceID { |
33 PRIMARY_SEQUENCE, | 33 PRIMARY_SEQUENCE, |
34 COMMIT_SEQUENCE | 34 COMMIT_SEQUENCE |
35 }; | 35 }; |
36 | 36 |
37 // The PostTask() and PostDelayedTask() methods defined by TaskRunner | 37 // The PostTask() and PostDelayedTask() methods defined by TaskRunner |
38 // post shutdown-blocking tasks on the primary sequence. | 38 // post shutdown-blocking tasks on the primary sequence. |
39 virtual bool PostDelayedTask( | 39 bool PostDelayedTask(const tracked_objects::Location& from_here, |
40 const tracked_objects::Location& from_here, | 40 const base::Closure& task, |
41 const base::Closure& task, | 41 base::TimeDelta delay) override = 0; |
42 base::TimeDelta delay) = 0; | |
43 | 42 |
44 // Posts a shutdown blocking task to |sequence_id|. | 43 // Posts a shutdown blocking task to |sequence_id|. |
45 virtual bool PostShutdownBlockingTask( | 44 virtual bool PostShutdownBlockingTask( |
46 const tracked_objects::Location& from_here, | 45 const tracked_objects::Location& from_here, |
47 SequenceID sequence_id, | 46 SequenceID sequence_id, |
48 const base::Closure& task) = 0; | 47 const base::Closure& task) = 0; |
49 | 48 |
50 // The TaskRunner override returns true if the current thread is running | 49 // The TaskRunner override returns true if the current thread is running |
51 // on the primary sequence. | 50 // on the primary sequence. |
52 bool RunsTasksOnCurrentThread() const override; | 51 bool RunsTasksOnCurrentThread() const override; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 protected: | 121 protected: |
123 ~MockDOMStorageTaskRunner() override; | 122 ~MockDOMStorageTaskRunner() override; |
124 | 123 |
125 private: | 124 private: |
126 const scoped_refptr<base::MessageLoopProxy> message_loop_; | 125 const scoped_refptr<base::MessageLoopProxy> message_loop_; |
127 }; | 126 }; |
128 | 127 |
129 } // namespace content | 128 } // namespace content |
130 | 129 |
131 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ | 130 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ |
OLD | NEW |