OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2013 Google Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #include "core/dom/MainThreadTaskRunner.h" | 27 #include "core/dom/MainThreadTaskRunner.h" |
28 | 28 |
29 #include "core/dom/ExecutionContext.h" | 29 #include "core/dom/ExecutionContext.h" |
30 #include "core/dom/ExecutionContextTask.h" | 30 #include "core/dom/ExecutionContextTask.h" |
31 #include "core/inspector/InspectorInstrumentation.h" | 31 #include "core/inspector/InspectorInstrumentation.h" |
32 #include "platform/CrossThreadFunctional.h" | |
33 #include "public/platform/Platform.h" | 32 #include "public/platform/Platform.h" |
34 #include "wtf/Assertions.h" | 33 #include "wtf/Assertions.h" |
| 34 #include "wtf/Functional.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 MainThreadTaskRunner::MainThreadTaskRunner(ExecutionContext* context) | 38 MainThreadTaskRunner::MainThreadTaskRunner(ExecutionContext* context) |
39 : m_context(context) | 39 : m_context(context) |
40 , m_pendingTasksTimer(this, &MainThreadTaskRunner::pendingTasksTimerFired) | 40 , m_pendingTasksTimer(this, &MainThreadTaskRunner::pendingTasksTimerFired) |
41 , m_suspended(false) | 41 , m_suspended(false) |
42 , m_weakFactory(this) | 42 , m_weakFactory(this) |
43 { | 43 { |
44 } | 44 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 while (!m_pendingTasks.isEmpty()) { | 112 while (!m_pendingTasks.isEmpty()) { |
113 std::unique_ptr<ExecutionContextTask> task = std::move(m_pendingTasks[0]
.first); | 113 std::unique_ptr<ExecutionContextTask> task = std::move(m_pendingTasks[0]
.first); |
114 const bool instrumenting = m_pendingTasks[0].second; | 114 const bool instrumenting = m_pendingTasks[0].second; |
115 m_pendingTasks.remove(0); | 115 m_pendingTasks.remove(0); |
116 InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), ins
trumenting); | 116 InspectorInstrumentation::AsyncTask asyncTask(m_context, task.get(), ins
trumenting); |
117 task->performTask(m_context); | 117 task->performTask(m_context); |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 } // namespace blink | 121 } // namespace blink |
OLD | NEW |