| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // Returns true if the current thread is running on the given |sequence_id|. | 53 // Returns true if the current thread is running on the given |sequence_id|. |
| 54 virtual bool IsRunningOnSequence(SequenceID sequence_id) const = 0; | 54 virtual bool IsRunningOnSequence(SequenceID sequence_id) const = 0; |
| 55 bool IsRunningOnPrimarySequence() const { | 55 bool IsRunningOnPrimarySequence() const { |
| 56 return IsRunningOnSequence(PRIMARY_SEQUENCE); | 56 return IsRunningOnSequence(PRIMARY_SEQUENCE); |
| 57 } | 57 } |
| 58 bool IsRunningOnCommitSequence() const { | 58 bool IsRunningOnCommitSequence() const { |
| 59 return IsRunningOnSequence(COMMIT_SEQUENCE); | 59 return IsRunningOnSequence(COMMIT_SEQUENCE); |
| 60 } | 60 } |
| 61 | 61 |
| 62 // DEPRECATED: Only here because base::TaskRunner requires it, implemented | |
| 63 // by calling the virtual PostDelayedTask(..., TimeDelta) variant. | |
| 64 virtual bool PostDelayedTask( | |
| 65 const tracked_objects::Location& from_here, | |
| 66 const base::Closure& task, | |
| 67 int64 delay_ms) OVERRIDE; | |
| 68 | |
| 69 protected: | 62 protected: |
| 70 virtual ~DomStorageTaskRunner() {} | 63 virtual ~DomStorageTaskRunner() {} |
| 71 }; | 64 }; |
| 72 | 65 |
| 73 // A derived class used in chromium that utilizes a SequenceWorkerPool | 66 // A derived class used in chromium that utilizes a SequenceWorkerPool |
| 74 // under dom_storage specific SequenceTokens. The |delayed_task_loop| | 67 // under dom_storage specific SequenceTokens. The |delayed_task_loop| |
| 75 // is used to delay scheduling on the worker pool. | 68 // is used to delay scheduling on the worker pool. |
| 76 class DomStorageWorkerPoolTaskRunner : public DomStorageTaskRunner { | 69 class DomStorageWorkerPoolTaskRunner : public DomStorageTaskRunner { |
| 77 public: | 70 public: |
| 78 DomStorageWorkerPoolTaskRunner( | 71 DomStorageWorkerPoolTaskRunner( |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 protected: | 123 protected: |
| 131 virtual ~MockDomStorageTaskRunner(); | 124 virtual ~MockDomStorageTaskRunner(); |
| 132 | 125 |
| 133 private: | 126 private: |
| 134 const scoped_refptr<base::MessageLoopProxy> message_loop_; | 127 const scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 135 }; | 128 }; |
| 136 | 129 |
| 137 } // namespace dom_storage | 130 } // namespace dom_storage |
| 138 | 131 |
| 139 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ | 132 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TASK_RUNNER_ |
| OLD | NEW |