| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 EventTarget* eventTarget; | 81 EventTarget* eventTarget; |
| 82 const AtomicString eventType; | 82 const AtomicString eventType; |
| 83 const EventListenerVector eventListenerVector; | 83 const EventListenerVector eventListenerVector; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class InspectorDOMAgent FINAL : public InspectorBaseAgent<InspectorDOMAgent>, pu
blic InspectorBackendDispatcher::DOMCommandHandler { | 86 class InspectorDOMAgent FINAL : public InspectorBaseAgent<InspectorDOMAgent>, pu
blic InspectorBackendDispatcher::DOMCommandHandler { |
| 87 WTF_MAKE_NONCOPYABLE(InspectorDOMAgent); | 87 WTF_MAKE_NONCOPYABLE(InspectorDOMAgent); |
| 88 public: | 88 public: |
| 89 struct DOMListener { | 89 struct DOMListener : public WillBeGarbageCollectedMixin { |
| 90 virtual ~DOMListener() | 90 virtual ~DOMListener() |
| 91 { | 91 { |
| 92 } | 92 } |
| 93 virtual void didRemoveDocument(Document*) = 0; | 93 virtual void didRemoveDocument(Document*) = 0; |
| 94 virtual void didRemoveDOMNode(Node*) = 0; | 94 virtual void didRemoveDOMNode(Node*) = 0; |
| 95 virtual void didModifyDOMAttr(Element*) = 0; | 95 virtual void didModifyDOMAttr(Element*) = 0; |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 static PassOwnPtr<InspectorDOMAgent> create(InspectorPageAgent* pageAgent, I
njectedScriptManager* injectedScriptManager, InspectorOverlay* overlay) | 98 static PassOwnPtrWillBeRawPtr<InspectorDOMAgent> create(InspectorPageAgent*
pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overl
ay) |
| 99 { | 99 { |
| 100 return adoptPtr(new InspectorDOMAgent(pageAgent, injectedScriptManager,
overlay)); | 100 return adoptPtrWillBeNoop(new InspectorDOMAgent(pageAgent, injectedScrip
tManager, overlay)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 static String toErrorString(ExceptionState&); | 103 static String toErrorString(ExceptionState&); |
| 104 | 104 |
| 105 virtual ~InspectorDOMAgent(); | 105 virtual ~InspectorDOMAgent(); |
| 106 virtual void trace(Visitor*) OVERRIDE; |
| 106 | 107 |
| 107 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 108 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
| 108 virtual void clearFrontend() OVERRIDE; | 109 virtual void clearFrontend() OVERRIDE; |
| 109 virtual void restore() OVERRIDE; | 110 virtual void restore() OVERRIDE; |
| 110 | 111 |
| 111 Vector<Document*> documents(); | 112 WillBeHeapVector<RawPtrWillBeMember<Document> > documents(); |
| 112 void reset(); | 113 void reset(); |
| 113 | 114 |
| 114 // Methods called from the frontend for DOM nodes inspection. | 115 // Methods called from the frontend for DOM nodes inspection. |
| 115 virtual void enable(ErrorString*) OVERRIDE; | 116 virtual void enable(ErrorString*) OVERRIDE; |
| 116 virtual void disable(ErrorString*) OVERRIDE; | 117 virtual void disable(ErrorString*) OVERRIDE; |
| 117 virtual void querySelector(ErrorString*, int nodeId, const String& selectors
, int* elementId) OVERRIDE; | 118 virtual void querySelector(ErrorString*, int nodeId, const String& selectors
, int* elementId) OVERRIDE; |
| 118 virtual void querySelectorAll(ErrorString*, int nodeId, const String& select
ors, RefPtr<TypeBuilder::Array<int> >& result) OVERRIDE; | 119 virtual void querySelectorAll(ErrorString*, int nodeId, const String& select
ors, RefPtr<TypeBuilder::Array<int> >& result) OVERRIDE; |
| 119 virtual void getDocument(ErrorString*, RefPtr<TypeBuilder::DOM::Node>& root)
OVERRIDE; | 120 virtual void getDocument(ErrorString*, RefPtr<TypeBuilder::DOM::Node>& root)
OVERRIDE; |
| 120 virtual void requestChildNodes(ErrorString*, int nodeId, const int* depth) O
VERRIDE; | 121 virtual void requestChildNodes(ErrorString*, int nodeId, const int* depth) O
VERRIDE; |
| 121 virtual void setAttributeValue(ErrorString*, int elementId, const String& na
me, const String& value) OVERRIDE; | 122 virtual void setAttributeValue(ErrorString*, int elementId, const String& na
me, const String& value) OVERRIDE; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 147 virtual void redo(ErrorString*) OVERRIDE; | 148 virtual void redo(ErrorString*) OVERRIDE; |
| 148 virtual void markUndoableState(ErrorString*) OVERRIDE; | 149 virtual void markUndoableState(ErrorString*) OVERRIDE; |
| 149 virtual void focus(ErrorString*, int nodeId) OVERRIDE; | 150 virtual void focus(ErrorString*, int nodeId) OVERRIDE; |
| 150 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr
ray>& files) OVERRIDE; | 151 virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONAr
ray>& files) OVERRIDE; |
| 151 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM::
BoxModel>&) OVERRIDE; | 152 virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM::
BoxModel>&) OVERRIDE; |
| 152 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) OVE
RRIDE; | 153 virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId) OVE
RRIDE; |
| 153 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun
daryNodeId) OVERRIDE; | 154 virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoun
daryNodeId) OVERRIDE; |
| 154 | 155 |
| 155 static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& liste
nersArray, bool includeAncestors); | 156 static void getEventListeners(EventTarget*, Vector<EventListenerInfo>& liste
nersArray, bool includeAncestors); |
| 156 | 157 |
| 157 class Listener { | 158 class Listener : public WillBeGarbageCollectedMixin { |
| 158 public: | 159 public: |
| 159 virtual ~Listener() { } | 160 virtual ~Listener() { } |
| 160 virtual void domAgentWasEnabled() = 0; | 161 virtual void domAgentWasEnabled() = 0; |
| 161 virtual void domAgentWasDisabled() = 0; | 162 virtual void domAgentWasDisabled() = 0; |
| 162 }; | 163 }; |
| 163 void setListener(Listener* listener) { m_listener = listener; } | 164 void setListener(Listener* listener) { m_listener = listener; } |
| 164 | 165 |
| 165 bool enabled() const; | 166 bool enabled() const; |
| 166 | 167 |
| 167 // Methods called from the InspectorInstrumentation. | 168 // Methods called from the InspectorInstrumentation. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > buildArrayForPseudoE
lements(Element*, NodeToIdMap* nodesMap); | 250 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > buildArrayForPseudoE
lements(Element*, NodeToIdMap* nodesMap); |
| 250 | 251 |
| 251 Node* nodeForPath(const String& path); | 252 Node* nodeForPath(const String& path); |
| 252 | 253 |
| 253 void discardFrontendBindings(); | 254 void discardFrontendBindings(); |
| 254 | 255 |
| 255 void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* col
or, const RefPtr<JSONObject>* outlineColor); | 256 void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* col
or, const RefPtr<JSONObject>* outlineColor); |
| 256 | 257 |
| 257 bool pushDocumentUponHandlelessOperation(ErrorString*); | 258 bool pushDocumentUponHandlelessOperation(ErrorString*); |
| 258 | 259 |
| 259 InspectorPageAgent* m_pageAgent; | 260 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
| 261 // FIXME: Oilpan: Move InjectedScriptManager to heap in follow-up CL. |
| 260 InjectedScriptManager* m_injectedScriptManager; | 262 InjectedScriptManager* m_injectedScriptManager; |
| 261 InspectorOverlay* m_overlay; | 263 InspectorOverlay* m_overlay; |
| 262 InspectorFrontend::DOM* m_frontend; | 264 InspectorFrontend::DOM* m_frontend; |
| 263 DOMListener* m_domListener; | 265 RawPtrWillBeMember<DOMListener> m_domListener; |
| 264 OwnPtrWillBePersistent<NodeToIdMap> m_documentNodeToIdMap; | 266 OwnPtrWillBeMember<NodeToIdMap> m_documentNodeToIdMap; |
| 265 // Owns node mappings for dangling nodes. | 267 // Owns node mappings for dangling nodes. |
| 266 WillBePersistentHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeT
oIdMaps; | 268 WillBeHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeToIdMaps; |
| 267 WillBePersistentHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode; | 269 WillBeHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode; |
| 268 WillBePersistentHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNod
esMap; | 270 WillBeHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNodesMap; |
| 269 HashSet<int> m_childrenRequested; | 271 HashSet<int> m_childrenRequested; |
| 270 HashMap<int, int> m_cachedChildCount; | 272 HashMap<int, int> m_cachedChildCount; |
| 271 int m_lastNodeId; | 273 int m_lastNodeId; |
| 272 RefPtrWillBePersistent<Document> m_document; | 274 RefPtrWillBeMember<Document> m_document; |
| 273 typedef WillBePersistentHeapHashMap<String, WillBeHeapVector<RefPtrWillBeMem
ber<Node> > > SearchResults; | 275 typedef WillBeHeapHashMap<String, WillBeHeapVector<RefPtrWillBeMember<Node>
> > SearchResults; |
| 274 SearchResults m_searchResults; | 276 SearchResults m_searchResults; |
| 275 OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; | 277 OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; |
| 276 SearchMode m_searchingForNode; | 278 SearchMode m_searchingForNode; |
| 277 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; | 279 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; |
| 278 OwnPtrWillBePersistent<InspectorHistory> m_history; | 280 OwnPtrWillBeMember<InspectorHistory> m_history; |
| 279 OwnPtrWillBePersistent<DOMEditor> m_domEditor; | 281 OwnPtrWillBeMember<DOMEditor> m_domEditor; |
| 280 bool m_suppressAttributeModifiedEvent; | 282 bool m_suppressAttributeModifiedEvent; |
| 281 Listener* m_listener; | 283 RawPtrWillBeMember<Listener> m_listener; |
| 282 }; | 284 }; |
| 283 | 285 |
| 284 | 286 |
| 285 } // namespace blink | 287 } // namespace blink |
| 286 | 288 |
| 287 #endif // !defined(InspectorDOMAgent_h) | 289 #endif // !defined(InspectorDOMAgent_h) |
| OLD | NEW |