OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ |
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ | 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 | 27 |
28 // The PostTask() method, defined by TaskRunner, schedules a task | 28 // The PostTask() method, defined by TaskRunner, schedules a task |
29 // to run immediately. | 29 // to run immediately. |
30 | 30 |
31 // Schedules a task to be run after a delay. | 31 // Schedules a task to be run after a delay. |
32 virtual bool PostDelayedTask( | 32 virtual bool PostDelayedTask( |
33 const tracked_objects::Location& from_here, | 33 const tracked_objects::Location& from_here, |
34 const base::Closure& task, | 34 const base::Closure& task, |
35 base::TimeDelta delay) OVERRIDE; | 35 base::TimeDelta delay) OVERRIDE; |
36 | 36 |
37 // DEPRECATED: Only here because base::TaskRunner requires it, implemented | |
38 // by calling the virtual PostDelayedTask(..., TimeDelta) variant. | |
39 virtual bool PostDelayedTask( | |
40 const tracked_objects::Location& from_here, | |
41 const base::Closure& task, | |
42 int64 delay_ms) OVERRIDE; | |
43 | |
44 // Only here because base::TaskRunner requires it, the return | 37 // Only here because base::TaskRunner requires it, the return |
45 // value is hard coded to true. | 38 // value is hard coded to true. |
46 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; | 39 virtual bool RunsTasksOnCurrentThread() const OVERRIDE; |
47 | 40 |
48 // SequencedTaskRunner overrides, these are implemented in | 41 // SequencedTaskRunner overrides, these are implemented in |
49 // terms of PostDelayedTask and the latter is similarly deprecated. | 42 // terms of PostDelayedTask |
Sergey Ulanov
2012/03/15 19:58:50
nit: add period at then end of the sentence
| |
50 virtual bool PostNonNestableDelayedTask( | 43 virtual bool PostNonNestableDelayedTask( |
51 const tracked_objects::Location& from_here, | 44 const tracked_objects::Location& from_here, |
52 const base::Closure& task, | 45 const base::Closure& task, |
53 base::TimeDelta delay) OVERRIDE; | 46 base::TimeDelta delay) OVERRIDE; |
54 virtual bool PostNonNestableDelayedTask( | |
55 const tracked_objects::Location& from_here, | |
56 const base::Closure& task, | |
57 int64 delay_ms) OVERRIDE; | |
58 | 47 |
59 protected: | 48 protected: |
60 const scoped_refptr<base::MessageLoopProxy> message_loop_; | 49 const scoped_refptr<base::MessageLoopProxy> message_loop_; |
61 }; | 50 }; |
62 | 51 |
63 // A derived class that utlizes the SequenceWorkerPool under a | 52 // A derived class that utlizes the SequenceWorkerPool under a |
64 // dom_storage specific SequenceToken. The MessageLoopProxy | 53 // dom_storage specific SequenceToken. The MessageLoopProxy |
65 // is used to delay scheduling on the worker pool. | 54 // is used to delay scheduling on the worker pool. |
66 class DomStorageWorkerPoolTaskRunner : public DomStorageTaskRunner { | 55 class DomStorageWorkerPoolTaskRunner : public DomStorageTaskRunner { |
67 public: | 56 public: |
(...skipping 26 matching lines...) Expand all Loading... | |
94 | 83 |
95 virtual bool PostDelayedTask( | 84 virtual bool PostDelayedTask( |
96 const tracked_objects::Location& from_here, | 85 const tracked_objects::Location& from_here, |
97 const base::Closure& task, | 86 const base::Closure& task, |
98 base::TimeDelta delay) OVERRIDE; | 87 base::TimeDelta delay) OVERRIDE; |
99 }; | 88 }; |
100 | 89 |
101 } // namespace dom_storage | 90 } // namespace dom_storage |
102 | 91 |
103 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ | 92 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ |
OLD | NEW |