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 COMPONENTS_TEST_RUNNER_WEB_TASK_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_TASK_H_ |
6 #define COMPONENTS_TEST_RUNNER_WEB_TASK_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_TASK_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "third_party/WebKit/public/platform/WebTaskRunner.h" |
11 | 12 |
12 namespace test_runner { | 13 namespace test_runner { |
13 | 14 |
14 class WebTaskList; | 15 class WebTaskList; |
15 | 16 |
16 // WebTask represents a task which can run by WebTestDelegate::postTask() or | 17 // WebTask represents a task which can run by WebTestDelegate::postTask() or |
17 // WebTestDelegate::postDelayedTask(). | 18 // WebTestDelegate::postDelayedTask(). |
18 class WebTask { | 19 class WebTask : public blink::WebTaskRunner::Task { |
19 public: | 20 public: |
20 explicit WebTask(WebTaskList*); | 21 explicit WebTask(WebTaskList*); |
21 virtual ~WebTask(); | 22 ~WebTask() override; |
22 | 23 |
23 // The main code of this task. | 24 // The main code of this task. |
24 // An implementation of run() should return immediately if cancel() was | 25 // An implementation of run() should return immediately if cancel() was |
25 // called. | 26 // called. |
26 virtual void run() = 0; | 27 void run() override = 0; |
27 virtual void cancel() = 0; | 28 virtual void cancel() = 0; |
28 | 29 |
29 protected: | 30 protected: |
30 WebTaskList* task_list_; | 31 WebTaskList* task_list_; |
31 }; | 32 }; |
32 | 33 |
33 class WebTaskList { | 34 class WebTaskList { |
34 public: | 35 public: |
35 WebTaskList(); | 36 WebTaskList(); |
36 ~WebTaskList(); | 37 ~WebTaskList(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 69 |
69 virtual void RunIfValid() = 0; | 70 virtual void RunIfValid() = 0; |
70 | 71 |
71 protected: | 72 protected: |
72 T* object_; | 73 T* object_; |
73 }; | 74 }; |
74 | 75 |
75 } // namespace test_runner | 76 } // namespace test_runner |
76 | 77 |
77 #endif // COMPONENTS_TEST_RUNNER_WEB_TASK_H_ | 78 #endif // COMPONENTS_TEST_RUNNER_WEB_TASK_H_ |
OLD | NEW |