OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "core/inspector/InspectorTaskRunner.h" | 5 #include "core/inspector/InspectorTaskRunner.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 InspectorTaskRunner::IgnoreInterruptsScope::IgnoreInterruptsScope(InspectorTaskR
unner* taskRunner) | 9 InspectorTaskRunner::IgnoreInterruptsScope::IgnoreInterruptsScope(InspectorTaskR
unner* taskRunner) |
10 : m_wasIgnoring(taskRunner->m_ignoreInterrupts) | 10 : m_wasIgnoring(taskRunner->m_ignoreInterrupts) |
(...skipping 14 matching lines...) Expand all Loading... |
25 { | 25 { |
26 } | 26 } |
27 | 27 |
28 InspectorTaskRunner::~InspectorTaskRunner() | 28 InspectorTaskRunner::~InspectorTaskRunner() |
29 { | 29 { |
30 } | 30 } |
31 | 31 |
32 void InspectorTaskRunner::appendTask(std::unique_ptr<Task> task) | 32 void InspectorTaskRunner::appendTask(std::unique_ptr<Task> task) |
33 { | 33 { |
34 MutexLocker lock(m_mutex); | 34 MutexLocker lock(m_mutex); |
| 35 if (m_killed) |
| 36 return; |
35 m_queue.append(std::move(task)); | 37 m_queue.append(std::move(task)); |
36 m_condition.signal(); | 38 m_condition.signal(); |
37 } | 39 } |
38 | 40 |
39 std::unique_ptr<InspectorTaskRunner::Task> InspectorTaskRunner::takeNextTask(Ins
pectorTaskRunner::WaitMode waitMode) | 41 std::unique_ptr<InspectorTaskRunner::Task> InspectorTaskRunner::takeNextTask(Ins
pectorTaskRunner::WaitMode waitMode) |
40 { | 42 { |
41 MutexLocker lock(m_mutex); | 43 MutexLocker lock(m_mutex); |
42 bool timedOut = false; | 44 bool timedOut = false; |
43 | 45 |
44 static double infiniteTime = std::numeric_limits<double>::max(); | 46 static double infiniteTime = std::numeric_limits<double>::max(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 80 |
79 void InspectorTaskRunner::v8InterruptCallback(v8::Isolate*, void* data) | 81 void InspectorTaskRunner::v8InterruptCallback(v8::Isolate*, void* data) |
80 { | 82 { |
81 InspectorTaskRunner* runner = static_cast<InspectorTaskRunner*>(data); | 83 InspectorTaskRunner* runner = static_cast<InspectorTaskRunner*>(data); |
82 if (runner->m_ignoreInterrupts) | 84 if (runner->m_ignoreInterrupts) |
83 return; | 85 return; |
84 runner->runAllTasksDontWait(); | 86 runner->runAllTasksDontWait(); |
85 } | 87 } |
86 | 88 |
87 } // namespace blink | 89 } // namespace blink |
OLD | NEW |