Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: third_party/WebKit/Source/core/inspector/InspectorTaskRunner.cpp

Issue 2041753002: Worker: Protect a running debugger task from forcible worker termination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak if-condition Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/WorkerInspectorController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698