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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 | 302 |
303 // static | 303 // static |
304 void ThreadDebugger::getEventListenersCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 304 void ThreadDebugger::getEventListenersCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
305 { | 305 { |
306 if (info.Length() < 1) | 306 if (info.Length() < 1) |
307 return; | 307 return; |
308 | 308 |
309 ThreadDebugger* debugger = static_cast<ThreadDebugger*>(v8::Local<v8::Extern
al>::Cast(info.Data())->Value()); | 309 ThreadDebugger* debugger = static_cast<ThreadDebugger*>(v8::Local<v8::Extern
al>::Cast(info.Data())->Value()); |
310 DCHECK(debugger); | 310 DCHECK(debugger); |
311 v8::Isolate* isolate = info.GetIsolate(); | 311 v8::Isolate* isolate = info.GetIsolate(); |
| 312 int groupId = debugger->contextGroupId(toExecutionContext(isolate->GetCurren
tContext())); |
312 | 313 |
313 V8EventListenerInfoList listenerInfo; | 314 V8EventListenerInfoList listenerInfo; |
314 // eventListeners call can produce message on ErrorEvent during lazy event l
istener compilation. | 315 // eventListeners call can produce message on ErrorEvent during lazy event l
istener compilation. |
315 debugger->muteWarningsAndDeprecations(); | 316 if (groupId) |
| 317 debugger->muteWarningsAndDeprecations(groupId); |
316 InspectorDOMDebuggerAgent::eventListenersInfoForTarget(isolate, info[0], lis
tenerInfo); | 318 InspectorDOMDebuggerAgent::eventListenersInfoForTarget(isolate, info[0], lis
tenerInfo); |
317 debugger->unmuteWarningsAndDeprecations(); | 319 if (groupId) |
| 320 debugger->unmuteWarningsAndDeprecations(groupId); |
318 | 321 |
319 v8::Local<v8::Object> result = v8::Object::New(isolate); | 322 v8::Local<v8::Object> result = v8::Object::New(isolate); |
320 AtomicString currentEventType; | 323 AtomicString currentEventType; |
321 v8::Local<v8::Array> listeners; | 324 v8::Local<v8::Array> listeners; |
322 size_t outputIndex = 0; | 325 size_t outputIndex = 0; |
323 for (auto& info : listenerInfo) { | 326 for (auto& info : listenerInfo) { |
324 if (currentEventType != info.eventType) { | 327 if (currentEventType != info.eventType) { |
325 currentEventType = info.eventType; | 328 currentEventType = info.eventType; |
326 listeners = v8::Array::New(isolate); | 329 listeners = v8::Array::New(isolate); |
327 outputIndex = 0; | 330 outputIndex = 0; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 { | 388 { |
386 for (size_t index = 0; index < m_timers.size(); ++index) { | 389 for (size_t index = 0; index < m_timers.size(); ++index) { |
387 if (m_timers[index].get() == timer) { | 390 if (m_timers[index].get() == timer) { |
388 m_timerCallbacks[index](m_timerData[index]); | 391 m_timerCallbacks[index](m_timerData[index]); |
389 return; | 392 return; |
390 } | 393 } |
391 } | 394 } |
392 } | 395 } |
393 | 396 |
394 } // namespace blink | 397 } // namespace blink |
OLD | NEW |