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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 m_domBreakpoints.remove(node); | 425 m_domBreakpoints.remove(node); |
426 | 426 |
427 uint32_t newRootMask = rootMask & ~newMask; | 427 uint32_t newRootMask = rootMask & ~newMask; |
428 if (!newRootMask) | 428 if (!newRootMask) |
429 return; | 429 return; |
430 | 430 |
431 for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; child =
InspectorDOMAgent::innerNextSibling(child)) | 431 for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; child =
InspectorDOMAgent::innerNextSibling(child)) |
432 updateSubtreeBreakpoints(child, newRootMask, set); | 432 updateSubtreeBreakpoints(child, newRootMask, set); |
433 } | 433 } |
434 | 434 |
435 void InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded(PassRefPtr<JSONObject
> eventData, bool synchronous) | 435 void InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded(PassRefPtr<JSONObject
> prpEventData, bool synchronous) |
436 { | 436 { |
437 if (!eventData) | 437 if (!prpEventData) |
438 return; | 438 return; |
| 439 RefPtr<JSONObject> eventData = prpEventData; |
| 440 InspectorFrontend::Debugger::Reason::Enum breakReason = InspectorFrontend::D
ebugger::Reason::EventListener; |
| 441 if (m_pauseInNextEventListener) { |
| 442 m_pauseInNextEventListener = false; |
| 443 breakReason = InspectorFrontend::Debugger::Reason::Other; |
| 444 eventData = nullptr; |
| 445 } |
439 if (synchronous) | 446 if (synchronous) |
440 m_debuggerAgent->breakProgram(InspectorFrontend::Debugger::Reason::Event
Listener, eventData); | 447 m_debuggerAgent->breakProgram(breakReason, eventData.release()); |
441 else | 448 else |
442 m_debuggerAgent->schedulePauseOnNextStatement(InspectorFrontend::Debugge
r::Reason::EventListener, eventData); | 449 m_debuggerAgent->schedulePauseOnNextStatement(breakReason, eventData.rel
ease()); |
443 } | 450 } |
444 | 451 |
445 PassRefPtr<JSONObject> InspectorDOMDebuggerAgent::preparePauseOnNativeEventData(
const String& eventName, const String* targetName) | 452 PassRefPtr<JSONObject> InspectorDOMDebuggerAgent::preparePauseOnNativeEventData(
const String& eventName, const String* targetName) |
446 { | 453 { |
447 String fullEventName = (targetName ? listenerEventCategoryType : instrumenta
tionEventCategoryType) + eventName; | 454 String fullEventName = (targetName ? listenerEventCategoryType : instrumenta
tionEventCategoryType) + eventName; |
448 if (m_pauseInNextEventListener) { | 455 if (!m_pauseInNextEventListener) { |
449 m_pauseInNextEventListener = false; | |
450 } else { | |
451 RefPtr<JSONObject> eventListenerBreakpoints = m_state->getObject(DOMDebu
ggerAgentState::eventListenerBreakpoints); | 456 RefPtr<JSONObject> eventListenerBreakpoints = m_state->getObject(DOMDebu
ggerAgentState::eventListenerBreakpoints); |
452 JSONObject::iterator it = eventListenerBreakpoints->find(fullEventName); | 457 JSONObject::iterator it = eventListenerBreakpoints->find(fullEventName); |
453 if (it == eventListenerBreakpoints->end()) | 458 if (it == eventListenerBreakpoints->end()) |
454 return nullptr; | 459 return nullptr; |
455 bool match = false; | 460 bool match = false; |
456 RefPtr<JSONObject> breakpointsByTarget = it->value->asObject(); | 461 RefPtr<JSONObject> breakpointsByTarget = it->value->asObject(); |
457 breakpointsByTarget->getBoolean(DOMDebuggerAgentState::eventTargetAny, &
match); | 462 breakpointsByTarget->getBoolean(DOMDebuggerAgentState::eventTargetAny, &
match); |
458 if (!match && targetName) | 463 if (!match && targetName) |
459 breakpointsByTarget->getBoolean(targetName->lower(), &match); | 464 breakpointsByTarget->getBoolean(targetName->lower(), &match); |
460 if (!match) | 465 if (!match) |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 } | 618 } |
614 | 619 |
615 void InspectorDOMDebuggerAgent::clear() | 620 void InspectorDOMDebuggerAgent::clear() |
616 { | 621 { |
617 m_domBreakpoints.clear(); | 622 m_domBreakpoints.clear(); |
618 m_pauseInNextEventListener = false; | 623 m_pauseInNextEventListener = false; |
619 } | 624 } |
620 | 625 |
621 } // namespace blink | 626 } // namespace blink |
622 | 627 |
OLD | NEW |