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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 void InspectorDOMDebuggerAgent::setInstrumentationBreakpoint(ErrorString* error,
const String& eventName) | 177 void InspectorDOMDebuggerAgent::setInstrumentationBreakpoint(ErrorString* error,
const String& eventName) |
178 { | 178 { |
179 setBreakpoint(error, String(instrumentationEventCategoryType) + eventName, S
tring()); | 179 setBreakpoint(error, String(instrumentationEventCategoryType) + eventName, S
tring()); |
180 } | 180 } |
181 | 181 |
182 static PassRefPtr<JSONObject> ensurePropertyObject(PassRefPtr<JSONObject> object
, const String& propertyName) | 182 static PassRefPtr<JSONObject> ensurePropertyObject(PassRefPtr<JSONObject> object
, const String& propertyName) |
183 { | 183 { |
184 JSONObject::iterator it = object->find(propertyName); | 184 JSONObject::iterator it = object->find(propertyName); |
185 if (it != object->end()) | 185 if (it != object->end()) |
186 return it->value->asObject(); | 186 return JSONObject::cast(it->value); |
187 | 187 |
188 RefPtr<JSONObject> result = JSONObject::create(); | 188 RefPtr<JSONObject> result = JSONObject::create(); |
189 object->setObject(propertyName, result); | 189 object->setObject(propertyName, result); |
190 return result.release(); | 190 return result.release(); |
191 } | 191 } |
192 | 192 |
193 PassRefPtr<JSONObject> InspectorDOMDebuggerAgent::eventListenerBreakpoints() | 193 PassRefPtr<JSONObject> InspectorDOMDebuggerAgent::eventListenerBreakpoints() |
194 { | 194 { |
195 RefPtr<JSONObject> breakpoints = m_state->getObject(DOMDebuggerAgentState::e
ventListenerBreakpoints); | 195 RefPtr<JSONObject> breakpoints = m_state->getObject(DOMDebuggerAgentState::e
ventListenerBreakpoints); |
196 if (!breakpoints) { | 196 if (!breakpoints) { |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 } | 530 } |
531 | 531 |
532 PassRefPtr<JSONObject> InspectorDOMDebuggerAgent::preparePauseOnNativeEventData(
const String& eventName, const String* targetName) | 532 PassRefPtr<JSONObject> InspectorDOMDebuggerAgent::preparePauseOnNativeEventData(
const String& eventName, const String* targetName) |
533 { | 533 { |
534 String fullEventName = (targetName ? listenerEventCategoryType : instrumenta
tionEventCategoryType) + eventName; | 534 String fullEventName = (targetName ? listenerEventCategoryType : instrumenta
tionEventCategoryType) + eventName; |
535 RefPtr<JSONObject> breakpoints = eventListenerBreakpoints(); | 535 RefPtr<JSONObject> breakpoints = eventListenerBreakpoints(); |
536 JSONObject::iterator it = breakpoints->find(fullEventName); | 536 JSONObject::iterator it = breakpoints->find(fullEventName); |
537 if (it == breakpoints->end()) | 537 if (it == breakpoints->end()) |
538 return nullptr; | 538 return nullptr; |
539 bool match = false; | 539 bool match = false; |
540 RefPtr<JSONObject> breakpointsByTarget = it->value->asObject(); | 540 RefPtr<JSONObject> breakpointsByTarget = JSONObject::cast(it->value); |
541 breakpointsByTarget->getBoolean(DOMDebuggerAgentState::eventTargetAny, &matc
h); | 541 breakpointsByTarget->getBoolean(DOMDebuggerAgentState::eventTargetAny, &matc
h); |
542 if (!match && targetName) | 542 if (!match && targetName) |
543 breakpointsByTarget->getBoolean(targetName->lower(), &match); | 543 breakpointsByTarget->getBoolean(targetName->lower(), &match); |
544 if (!match) | 544 if (!match) |
545 return nullptr; | 545 return nullptr; |
546 | 546 |
547 RefPtr<JSONObject> eventData = JSONObject::create(); | 547 RefPtr<JSONObject> eventData = JSONObject::create(); |
548 eventData->setString("eventName", fullEventName); | 548 eventData->setString("eventName", fullEventName); |
549 if (targetName) | 549 if (targetName) |
550 eventData->setString("targetName", *targetName); | 550 eventData->setString("targetName", *targetName); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 m_instrumentingAgents->setInspectorDOMDebuggerAgent(nullptr); | 709 m_instrumentingAgents->setInspectorDOMDebuggerAgent(nullptr); |
710 } | 710 } |
711 } | 711 } |
712 | 712 |
713 void InspectorDOMDebuggerAgent::didCommitLoadForLocalFrame(LocalFrame*) | 713 void InspectorDOMDebuggerAgent::didCommitLoadForLocalFrame(LocalFrame*) |
714 { | 714 { |
715 m_domBreakpoints.clear(); | 715 m_domBreakpoints.clear(); |
716 } | 716 } |
717 | 717 |
718 } // namespace blink | 718 } // namespace blink |
OLD | NEW |