OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 class WebSocketHandshakeResponse; | 73 class WebSocketHandshakeResponse; |
74 #endif | 74 #endif |
75 | 75 |
76 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value; | 76 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value; |
77 | 77 |
78 typedef pair<InstrumentingAgents*, int> InspectorInstrumentationCookie; | 78 typedef pair<InstrumentingAgents*, int> InspectorInstrumentationCookie; |
79 | 79 |
80 class InspectorInstrumentation { | 80 class InspectorInstrumentation { |
81 public: | 81 public: |
82 static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*); | 82 static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*); |
| 83 static bool isDebuggerPaused(Frame*); |
83 | 84 |
84 static void willInsertDOMNode(Document*, Node*, Node* parent); | 85 static void willInsertDOMNode(Document*, Node*, Node* parent); |
85 static void didInsertDOMNode(Document*, Node*); | 86 static void didInsertDOMNode(Document*, Node*); |
86 static void willRemoveDOMNode(Document*, Node*); | 87 static void willRemoveDOMNode(Document*, Node*); |
87 static void willModifyDOMAttr(Document*, Element*); | 88 static void willModifyDOMAttr(Document*, Element*); |
88 static void didModifyDOMAttr(Document*, Element*, const AtomicString& name,
const AtomicString& value); | 89 static void didModifyDOMAttr(Document*, Element*, const AtomicString& name,
const AtomicString& value); |
89 static void didRemoveDOMAttr(Document*, Element*, const AtomicString& name); | 90 static void didRemoveDOMAttr(Document*, Element*, const AtomicString& name); |
90 static void characterDataModified(Document*, CharacterData*); | 91 static void characterDataModified(Document*, CharacterData*); |
91 static void didInvalidateStyleAttr(Document*, Node*); | 92 static void didInvalidateStyleAttr(Document*, Node*); |
92 static void frameWindowDiscarded(Frame*, DOMWindow*); | 93 static void frameWindowDiscarded(Frame*, DOMWindow*); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 static bool collectingHTMLParseErrors(Page*); | 220 static bool collectingHTMLParseErrors(Page*); |
220 #else | 221 #else |
221 static bool hasFrontends() { return false; } | 222 static bool hasFrontends() { return false; } |
222 static bool hasFrontendForScriptContext(ScriptExecutionContext*) { return fa
lse; } | 223 static bool hasFrontendForScriptContext(ScriptExecutionContext*) { return fa
lse; } |
223 static bool collectingHTMLParseErrors(Page*) { return false; } | 224 static bool collectingHTMLParseErrors(Page*) { return false; } |
224 #endif | 225 #endif |
225 | 226 |
226 private: | 227 private: |
227 #if ENABLE(INSPECTOR) | 228 #if ENABLE(INSPECTOR) |
228 static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DO
MWrapperWorld*); | 229 static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DO
MWrapperWorld*); |
| 230 static bool isDebuggerPausedImpl(InstrumentingAgents*); |
229 | 231 |
230 static void willInsertDOMNodeImpl(InstrumentingAgents*, Node*, Node* parent)
; | 232 static void willInsertDOMNodeImpl(InstrumentingAgents*, Node*, Node* parent)
; |
231 static void didInsertDOMNodeImpl(InstrumentingAgents*, Node*); | 233 static void didInsertDOMNodeImpl(InstrumentingAgents*, Node*); |
232 static void willRemoveDOMNodeImpl(InstrumentingAgents*, Node*); | 234 static void willRemoveDOMNodeImpl(InstrumentingAgents*, Node*); |
233 static void didRemoveDOMNodeImpl(InstrumentingAgents*, Node*); | 235 static void didRemoveDOMNodeImpl(InstrumentingAgents*, Node*); |
234 static void willModifyDOMAttrImpl(InstrumentingAgents*, Element*); | 236 static void willModifyDOMAttrImpl(InstrumentingAgents*, Element*); |
235 static void didModifyDOMAttrImpl(InstrumentingAgents*, Element*, const Atomi
cString& name, const AtomicString& value); | 237 static void didModifyDOMAttrImpl(InstrumentingAgents*, Element*, const Atomi
cString& name, const AtomicString& value); |
236 static void didRemoveDOMAttrImpl(InstrumentingAgents*, Element*, const Atomi
cString& name); | 238 static void didRemoveDOMAttrImpl(InstrumentingAgents*, Element*, const Atomi
cString& name); |
237 static void characterDataModifiedImpl(InstrumentingAgents*, CharacterData*); | 239 static void characterDataModifiedImpl(InstrumentingAgents*, CharacterData*); |
238 static void didInvalidateStyleAttrImpl(InstrumentingAgents*, Node*); | 240 static void didInvalidateStyleAttrImpl(InstrumentingAgents*, Node*); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 }; | 374 }; |
373 | 375 |
374 inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame,
DOMWrapperWorld* world) | 376 inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame,
DOMWrapperWorld* world) |
375 { | 377 { |
376 #if ENABLE(INSPECTOR) | 378 #if ENABLE(INSPECTOR) |
377 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) | 379 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) |
378 didClearWindowObjectInWorldImpl(instrumentingAgents, frame, world); | 380 didClearWindowObjectInWorldImpl(instrumentingAgents, frame, world); |
379 #endif | 381 #endif |
380 } | 382 } |
381 | 383 |
| 384 inline bool InspectorInstrumentation::isDebuggerPaused(Frame* frame) |
| 385 { |
| 386 #if ENABLE(INSPECTOR) |
| 387 FAST_RETURN_IF_NO_FRONTENDS(false); |
| 388 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) |
| 389 return isDebuggerPausedImpl(instrumentingAgents); |
| 390 #endif |
| 391 return false; |
| 392 } |
| 393 |
382 inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node
* node, Node* parent) | 394 inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node
* node, Node* parent) |
383 { | 395 { |
384 #if ENABLE(INSPECTOR) | 396 #if ENABLE(INSPECTOR) |
385 FAST_RETURN_IF_NO_FRONTENDS(void()); | 397 FAST_RETURN_IF_NO_FRONTENDS(void()); |
386 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocumen
t(document)) | 398 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocumen
t(document)) |
387 willInsertDOMNodeImpl(instrumentingAgents, node, parent); | 399 willInsertDOMNodeImpl(instrumentingAgents, node, parent); |
388 #endif | 400 #endif |
389 } | 401 } |
390 | 402 |
391 inline void InspectorInstrumentation::didInsertDOMNode(Document* document, Node*
node) | 403 inline void InspectorInstrumentation::didInsertDOMNode(Document* document, Node*
node) |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 { | 1210 { |
1199 if (document) | 1211 if (document) |
1200 return instrumentingAgentsForPage(document->page()); | 1212 return instrumentingAgentsForPage(document->page()); |
1201 return 0; | 1213 return 0; |
1202 } | 1214 } |
1203 #endif | 1215 #endif |
1204 | 1216 |
1205 } // namespace WebCore | 1217 } // namespace WebCore |
1206 | 1218 |
1207 #endif // !defined(InspectorInstrumentation_h) | 1219 #endif // !defined(InspectorInstrumentation_h) |
OLD | NEW |