| 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 <memory> | 7 #include <memory> |
| 8 #include "bindings/core/v8/SourceLocation.h" | 8 #include "bindings/core/v8/SourceLocation.h" |
| 9 #include "bindings/core/v8/V8BindingForCore.h" | 9 #include "bindings/core/v8/V8BindingForCore.h" |
| 10 #include "bindings/core/v8/V8DOMException.h" | 10 #include "bindings/core/v8/V8DOMException.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 v8::Local<v8::Context> context, | 243 v8::Local<v8::Context> context, |
| 244 v8::Local<v8::Object> object) { | 244 v8::Local<v8::Object> object) { |
| 245 CreateFunctionProperty( | 245 CreateFunctionProperty( |
| 246 context, object, "getEventListeners", | 246 context, object, "getEventListeners", |
| 247 ThreadDebugger::GetEventListenersCallback, | 247 ThreadDebugger::GetEventListenersCallback, |
| 248 "function getEventListeners(node) { [Command Line API] }"); | 248 "function getEventListeners(node) { [Command Line API] }"); |
| 249 | 249 |
| 250 v8::Local<v8::Value> function_value; | 250 v8::Local<v8::Value> function_value; |
| 251 bool success = | 251 bool success = |
| 252 V8ScriptRunner::CompileAndRunInternalScript( | 252 V8ScriptRunner::CompileAndRunInternalScript( |
| 253 ExecutionContext::From(ScriptState::From(context)), |
| 253 V8String(isolate_, "(function(e) { console.log(e.type, e); })"), | 254 V8String(isolate_, "(function(e) { console.log(e.type, e); })"), |
| 254 isolate_) | 255 isolate_) |
| 255 .ToLocal(&function_value) && | 256 .ToLocal(&function_value) && |
| 256 function_value->IsFunction(); | 257 function_value->IsFunction(); |
| 257 DCHECK(success); | 258 DCHECK(success); |
| 258 CreateFunctionPropertyWithData( | 259 CreateFunctionPropertyWithData( |
| 259 context, object, "monitorEvents", ThreadDebugger::MonitorEventsCallback, | 260 context, object, "monitorEvents", ThreadDebugger::MonitorEventsCallback, |
| 260 function_value, | 261 function_value, |
| 261 "function monitorEvents(object, [types]) { [Command Line API] }"); | 262 "function monitorEvents(object, [types]) { [Command Line API] }"); |
| 262 CreateFunctionPropertyWithData( | 263 CreateFunctionPropertyWithData( |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void ThreadDebugger::OnTimer(TimerBase* timer) { | 472 void ThreadDebugger::OnTimer(TimerBase* timer) { |
| 472 for (size_t index = 0; index < timers_.size(); ++index) { | 473 for (size_t index = 0; index < timers_.size(); ++index) { |
| 473 if (timers_[index].get() == timer) { | 474 if (timers_[index].get() == timer) { |
| 474 timer_callbacks_[index](timer_data_[index]); | 475 timer_callbacks_[index](timer_data_[index]); |
| 475 return; | 476 return; |
| 476 } | 477 } |
| 477 } | 478 } |
| 478 } | 479 } |
| 479 | 480 |
| 480 } // namespace blink | 481 } // namespace blink |
| OLD | NEW |