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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 } | 600 } |
601 | 601 |
602 if (breakpointType == SubtreeModified) | 602 if (breakpointType == SubtreeModified) |
603 description->setBoolean("insertion", insertion); | 603 description->setBoolean("insertion", insertion); |
604 } | 604 } |
605 | 605 |
606 int breakpointOwnerNodeId = m_domAgent->boundNodeId(breakpointOwner); | 606 int breakpointOwnerNodeId = m_domAgent->boundNodeId(breakpointOwner); |
607 ASSERT(breakpointOwnerNodeId); | 607 ASSERT(breakpointOwnerNodeId); |
608 description->setInteger("nodeId", breakpointOwnerNodeId); | 608 description->setInteger("nodeId", breakpointOwnerNodeId); |
609 description->setString("type", domTypeName(breakpointType)); | 609 description->setString("type", domTypeName(breakpointType)); |
610 String json = description->toJSONString(); | 610 String json = description->serialize(); |
611 m_v8Session->breakProgram( | 611 m_v8Session->breakProgram( |
612 toV8InspectorStringView( | 612 toV8InspectorStringView( |
613 v8_inspector::protocol::Debugger::API::Paused::ReasonEnum::DOM), | 613 v8_inspector::protocol::Debugger::API::Paused::ReasonEnum::DOM), |
614 toV8InspectorStringView(json)); | 614 toV8InspectorStringView(json)); |
615 } | 615 } |
616 | 616 |
617 bool InspectorDOMDebuggerAgent::hasBreakpoint(Node* node, int type) { | 617 bool InspectorDOMDebuggerAgent::hasBreakpoint(Node* node, int type) { |
618 if (!m_domAgent->enabled()) | 618 if (!m_domAgent->enabled()) |
619 return false; | 619 return false; |
620 uint32_t rootBit = 1 << type; | 620 uint32_t rootBit = 1 << type; |
(...skipping 19 matching lines...) Expand all Loading... |
640 for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; | 640 for (Node* child = InspectorDOMAgent::innerFirstChild(node); child; |
641 child = InspectorDOMAgent::innerNextSibling(child)) | 641 child = InspectorDOMAgent::innerNextSibling(child)) |
642 updateSubtreeBreakpoints(child, newRootMask, set); | 642 updateSubtreeBreakpoints(child, newRootMask, set); |
643 } | 643 } |
644 | 644 |
645 void InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded( | 645 void InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded( |
646 std::unique_ptr<protocol::DictionaryValue> eventData, | 646 std::unique_ptr<protocol::DictionaryValue> eventData, |
647 bool synchronous) { | 647 bool synchronous) { |
648 if (!eventData) | 648 if (!eventData) |
649 return; | 649 return; |
650 String json = eventData->toJSONString(); | 650 String json = eventData->serialize(); |
651 if (synchronous) | 651 if (synchronous) |
652 m_v8Session->breakProgram( | 652 m_v8Session->breakProgram( |
653 toV8InspectorStringView(v8_inspector::protocol::Debugger::API::Paused:: | 653 toV8InspectorStringView(v8_inspector::protocol::Debugger::API::Paused:: |
654 ReasonEnum::EventListener), | 654 ReasonEnum::EventListener), |
655 toV8InspectorStringView(json)); | 655 toV8InspectorStringView(json)); |
656 else | 656 else |
657 m_v8Session->schedulePauseOnNextStatement( | 657 m_v8Session->schedulePauseOnNextStatement( |
658 toV8InspectorStringView(v8_inspector::protocol::Debugger::API::Paused:: | 658 toV8InspectorStringView(v8_inspector::protocol::Debugger::API::Paused:: |
659 ReasonEnum::EventListener), | 659 ReasonEnum::EventListener), |
660 toV8InspectorStringView(json)); | 660 toV8InspectorStringView(json)); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 } | 760 } |
761 } | 761 } |
762 | 762 |
763 if (breakpointURL.isNull()) | 763 if (breakpointURL.isNull()) |
764 return; | 764 return; |
765 | 765 |
766 std::unique_ptr<protocol::DictionaryValue> eventData = | 766 std::unique_ptr<protocol::DictionaryValue> eventData = |
767 protocol::DictionaryValue::create(); | 767 protocol::DictionaryValue::create(); |
768 eventData->setString("breakpointURL", breakpointURL); | 768 eventData->setString("breakpointURL", breakpointURL); |
769 eventData->setString("url", url); | 769 eventData->setString("url", url); |
770 String json = eventData->toJSONString(); | 770 String json = eventData->serialize(); |
771 m_v8Session->breakProgram( | 771 m_v8Session->breakProgram( |
772 toV8InspectorStringView( | 772 toV8InspectorStringView( |
773 v8_inspector::protocol::Debugger::API::Paused::ReasonEnum::XHR), | 773 v8_inspector::protocol::Debugger::API::Paused::ReasonEnum::XHR), |
774 toV8InspectorStringView(json)); | 774 toV8InspectorStringView(json)); |
775 } | 775 } |
776 | 776 |
777 void InspectorDOMDebuggerAgent::didAddBreakpoint() { | 777 void InspectorDOMDebuggerAgent::didAddBreakpoint() { |
778 if (m_state->booleanProperty(DOMDebuggerAgentState::enabled, false)) | 778 if (m_state->booleanProperty(DOMDebuggerAgentState::enabled, false)) |
779 return; | 779 return; |
780 setEnabled(true); | 780 setEnabled(true); |
(...skipping 19 matching lines...) Expand all Loading... |
800 m_state->remove(DOMDebuggerAgentState::enabled); | 800 m_state->remove(DOMDebuggerAgentState::enabled); |
801 m_instrumentingAgents->removeInspectorDOMDebuggerAgent(this); | 801 m_instrumentingAgents->removeInspectorDOMDebuggerAgent(this); |
802 } | 802 } |
803 } | 803 } |
804 | 804 |
805 void InspectorDOMDebuggerAgent::didCommitLoadForLocalFrame(LocalFrame*) { | 805 void InspectorDOMDebuggerAgent::didCommitLoadForLocalFrame(LocalFrame*) { |
806 m_domBreakpoints.clear(); | 806 m_domBreakpoints.clear(); |
807 } | 807 } |
808 | 808 |
809 } // namespace blink | 809 } // namespace blink |
OLD | NEW |