| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project 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 V8_CANCELABLE_TASK_H_ | 5 #ifndef V8_CANCELABLE_TASK_H_ |
| 6 #define V8_CANCELABLE_TASK_H_ | 6 #define V8_CANCELABLE_TASK_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "include/v8-platform.h" | 10 #include "include/v8-platform.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // to abort it. | 127 // to abort it. |
| 128 base::AtomicNumber<intptr_t> cancel_counter_; | 128 base::AtomicNumber<intptr_t> cancel_counter_; |
| 129 | 129 |
| 130 friend class CancelableTaskManager; | 130 friend class CancelableTaskManager; |
| 131 | 131 |
| 132 DISALLOW_COPY_AND_ASSIGN(Cancelable); | 132 DISALLOW_COPY_AND_ASSIGN(Cancelable); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 | 135 |
| 136 // Multiple inheritance can be used because Task is a pure interface. | 136 // Multiple inheritance can be used because Task is a pure interface. |
| 137 class CancelableTask : public Cancelable, public Task { | 137 class V8_EXPORT_PRIVATE CancelableTask : public Cancelable, |
| 138 NON_EXPORTED_BASE(public Task) { |
| 138 public: | 139 public: |
| 139 explicit CancelableTask(Isolate* isolate); | 140 explicit CancelableTask(Isolate* isolate); |
| 140 CancelableTask(Isolate* isolate, CancelableTaskManager* manager); | 141 CancelableTask(Isolate* isolate, CancelableTaskManager* manager); |
| 141 | 142 |
| 142 // Task overrides. | 143 // Task overrides. |
| 143 void Run() final { | 144 void Run() final { |
| 144 if (TryRun()) { | 145 if (TryRun()) { |
| 145 RunInternal(); | 146 RunInternal(); |
| 146 } | 147 } |
| 147 } | 148 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 176 private: | 177 private: |
| 177 Isolate* isolate_; | 178 Isolate* isolate_; |
| 178 DISALLOW_COPY_AND_ASSIGN(CancelableIdleTask); | 179 DISALLOW_COPY_AND_ASSIGN(CancelableIdleTask); |
| 179 }; | 180 }; |
| 180 | 181 |
| 181 | 182 |
| 182 } // namespace internal | 183 } // namespace internal |
| 183 } // namespace v8 | 184 } // namespace v8 |
| 184 | 185 |
| 185 #endif // V8_CANCELABLE_TASK_H_ | 186 #endif // V8_CANCELABLE_TASK_H_ |
| OLD | NEW |