OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 void InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded(PassRefPtr<JSONObject
> eventData, bool synchronous) | 410 void InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded(PassRefPtr<JSONObject
> eventData, bool synchronous) |
411 { | 411 { |
412 if (!eventData) | 412 if (!eventData) |
413 return; | 413 return; |
414 if (synchronous) | 414 if (synchronous) |
415 m_debuggerAgent->breakProgram(InspectorFrontend::Debugger::Reason::Event
Listener, eventData); | 415 m_debuggerAgent->breakProgram(InspectorFrontend::Debugger::Reason::Event
Listener, eventData); |
416 else | 416 else |
417 m_debuggerAgent->schedulePauseOnNextStatement(InspectorFrontend::Debugge
r::Reason::EventListener, eventData); | 417 m_debuggerAgent->schedulePauseOnNextStatement(InspectorFrontend::Debugge
r::Reason::EventListener, eventData); |
418 } | 418 } |
419 | 419 |
420 PassRefPtr<JSONObject> InspectorDOMDebuggerAgent::preparePauseOnNativeEventData(
const String& eventName, const AtomicString* targetName) | 420 PassRefPtr<JSONObject> InspectorDOMDebuggerAgent::preparePauseOnNativeEventData(
const String& eventName, const String* targetName) |
421 { | 421 { |
422 String fullEventName = (targetName ? listenerEventCategoryType : instrumenta
tionEventCategoryType) + eventName; | 422 String fullEventName = (targetName ? listenerEventCategoryType : instrumenta
tionEventCategoryType) + eventName; |
423 if (m_pauseInNextEventListener) { | 423 if (m_pauseInNextEventListener) { |
424 m_pauseInNextEventListener = false; | 424 m_pauseInNextEventListener = false; |
425 } else { | 425 } else { |
426 RefPtr<JSONObject> eventListenerBreakpoints = m_state->getObject(DOMDebu
ggerAgentState::eventListenerBreakpoints); | 426 RefPtr<JSONObject> eventListenerBreakpoints = m_state->getObject(DOMDebu
ggerAgentState::eventListenerBreakpoints); |
427 JSONObject::iterator it = eventListenerBreakpoints->find(fullEventName); | 427 JSONObject::iterator it = eventListenerBreakpoints->find(fullEventName); |
428 if (it == eventListenerBreakpoints->end()) | 428 if (it == eventListenerBreakpoints->end()) |
429 return nullptr; | 429 return nullptr; |
430 bool match = false; | 430 bool match = false; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 pauseOnNativeEventIfNeeded(preparePauseOnNativeEventData(cancelAnimationFram
eEventName, 0), true); | 468 pauseOnNativeEventIfNeeded(preparePauseOnNativeEventData(cancelAnimationFram
eEventName, 0), true); |
469 } | 469 } |
470 | 470 |
471 void InspectorDOMDebuggerAgent::willFireAnimationFrame(Document*, int) | 471 void InspectorDOMDebuggerAgent::willFireAnimationFrame(Document*, int) |
472 { | 472 { |
473 pauseOnNativeEventIfNeeded(preparePauseOnNativeEventData(animationFrameFired
EventName, 0), false); | 473 pauseOnNativeEventIfNeeded(preparePauseOnNativeEventData(animationFrameFired
EventName, 0), false); |
474 } | 474 } |
475 | 475 |
476 void InspectorDOMDebuggerAgent::willHandleEvent(EventTarget* target, Event* even
t, EventListener*, bool) | 476 void InspectorDOMDebuggerAgent::willHandleEvent(EventTarget* target, Event* even
t, EventListener*, bool) |
477 { | 477 { |
478 pauseOnNativeEventIfNeeded(preparePauseOnNativeEventData(event->type(), &tar
get->interfaceName()), false); | 478 Node* node = target->toNode(); |
| 479 String targetName = node ? node->nodeName() : target->interfaceName(); |
| 480 pauseOnNativeEventIfNeeded(preparePauseOnNativeEventData(event->type(), &tar
getName), false); |
479 } | 481 } |
480 | 482 |
481 void InspectorDOMDebuggerAgent::willExecuteCustomElementCallback(Element*) | 483 void InspectorDOMDebuggerAgent::willExecuteCustomElementCallback(Element*) |
482 { | 484 { |
483 pauseOnNativeEventIfNeeded(preparePauseOnNativeEventData(customElementCallba
ckName, 0), false); | 485 pauseOnNativeEventIfNeeded(preparePauseOnNativeEventData(customElementCallba
ckName, 0), false); |
484 } | 486 } |
485 | 487 |
486 void InspectorDOMDebuggerAgent::didFireWebGLError(const String& errorName) | 488 void InspectorDOMDebuggerAgent::didFireWebGLError(const String& errorName) |
487 { | 489 { |
488 RefPtr<JSONObject> eventData = preparePauseOnNativeEventData(webglErrorFired
EventName, 0); | 490 RefPtr<JSONObject> eventData = preparePauseOnNativeEventData(webglErrorFired
EventName, 0); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 } | 557 } |
556 | 558 |
557 void InspectorDOMDebuggerAgent::clear() | 559 void InspectorDOMDebuggerAgent::clear() |
558 { | 560 { |
559 m_domBreakpoints.clear(); | 561 m_domBreakpoints.clear(); |
560 m_pauseInNextEventListener = false; | 562 m_pauseInNextEventListener = false; |
561 } | 563 } |
562 | 564 |
563 } // namespace WebCore | 565 } // namespace WebCore |
564 | 566 |
OLD | NEW |