| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ThreadDebugger.h" | 5 #include "core/inspector/ThreadDebugger.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/SourceLocation.h" | 7 #include "bindings/core/v8/SourceLocation.h" |
| 8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "bindings/core/v8/V8DOMException.h" | 9 #include "bindings/core/v8/V8DOMException.h" |
| 10 #include "bindings/core/v8/V8DOMTokenList.h" | 10 #include "bindings/core/v8/V8DOMTokenList.h" |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 new Timer<ThreadDebugger>(this, &ThreadDebugger::onTimer)); | 452 new Timer<ThreadDebugger>(this, &ThreadDebugger::onTimer)); |
| 453 Timer<ThreadDebugger>* timerPtr = timer.get(); | 453 Timer<ThreadDebugger>* timerPtr = timer.get(); |
| 454 m_timers.push_back(std::move(timer)); | 454 m_timers.push_back(std::move(timer)); |
| 455 timerPtr->startRepeating(interval, BLINK_FROM_HERE); | 455 timerPtr->startRepeating(interval, BLINK_FROM_HERE); |
| 456 } | 456 } |
| 457 | 457 |
| 458 void ThreadDebugger::cancelTimer(void* data) { | 458 void ThreadDebugger::cancelTimer(void* data) { |
| 459 for (size_t index = 0; index < m_timerData.size(); ++index) { | 459 for (size_t index = 0; index < m_timerData.size(); ++index) { |
| 460 if (m_timerData[index] == data) { | 460 if (m_timerData[index] == data) { |
| 461 m_timers[index]->stop(); | 461 m_timers[index]->stop(); |
| 462 m_timerCallbacks.remove(index); | 462 m_timerCallbacks.erase(index); |
| 463 m_timers.remove(index); | 463 m_timers.erase(index); |
| 464 m_timerData.remove(index); | 464 m_timerData.erase(index); |
| 465 return; | 465 return; |
| 466 } | 466 } |
| 467 } | 467 } |
| 468 } | 468 } |
| 469 | 469 |
| 470 void ThreadDebugger::onTimer(TimerBase* timer) { | 470 void ThreadDebugger::onTimer(TimerBase* timer) { |
| 471 for (size_t index = 0; index < m_timers.size(); ++index) { | 471 for (size_t index = 0; index < m_timers.size(); ++index) { |
| 472 if (m_timers[index].get() == timer) { | 472 if (m_timers[index].get() == timer) { |
| 473 m_timerCallbacks[index](m_timerData[index]); | 473 m_timerCallbacks[index](m_timerData[index]); |
| 474 return; | 474 return; |
| 475 } | 475 } |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace blink | 479 } // namespace blink |
| OLD | NEW |