Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: Source/core/inspector/InspectorDOMAgent.h

Issue 307943002: Oilpan: Prepare moving InspectorController and InspectorAgents to oilpan. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > buildArrayForPseudoE lements(Element*, NodeToIdMap* nodesMap); 247 PassRefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > buildArrayForPseudoE lements(Element*, NodeToIdMap* nodesMap);
247 248
248 Node* nodeForPath(const String& path); 249 Node* nodeForPath(const String& path);
249 250
250 void discardFrontendBindings(); 251 void discardFrontendBindings();
251 252
252 void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* col or, const RefPtr<JSONObject>* outlineColor); 253 void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* col or, const RefPtr<JSONObject>* outlineColor);
253 254
254 bool pushDocumentUponHandlelessOperation(ErrorString*); 255 bool pushDocumentUponHandlelessOperation(ErrorString*);
255 256
256 InspectorPageAgent* m_pageAgent; 257 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
258 // FIXME: Oilpan: Move InjectedScriptManager to heap in follow-up CL.
257 InjectedScriptManager* m_injectedScriptManager; 259 InjectedScriptManager* m_injectedScriptManager;
258 InspectorOverlay* m_overlay; 260 InspectorOverlay* m_overlay;
259 InspectorFrontend::DOM* m_frontend; 261 InspectorFrontend::DOM* m_frontend;
260 DOMListener* m_domListener; 262 RawPtrWillBeMember<DOMListener> m_domListener;
261 OwnPtrWillBePersistent<NodeToIdMap> m_documentNodeToIdMap; 263 OwnPtrWillBeMember<NodeToIdMap> m_documentNodeToIdMap;
262 // Owns node mappings for dangling nodes. 264 // Owns node mappings for dangling nodes.
263 WillBePersistentHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeT oIdMaps; 265 WillBeHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeToIdMaps;
264 WillBePersistentHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode; 266 WillBeHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode;
265 WillBePersistentHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNod esMap; 267 WillBeHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNodesMap;
266 HashSet<int> m_childrenRequested; 268 HashSet<int> m_childrenRequested;
267 HashMap<int, int> m_cachedChildCount; 269 HashMap<int, int> m_cachedChildCount;
268 int m_lastNodeId; 270 int m_lastNodeId;
269 RefPtrWillBePersistent<Document> m_document; 271 RefPtrWillBeMember<Document> m_document;
270 typedef WillBePersistentHeapHashMap<String, WillBeHeapVector<RefPtrWillBeMem ber<Node> > > SearchResults; 272 typedef WillBeHeapHashMap<String, WillBeHeapVector<RefPtrWillBeMember<Node> > > SearchResults;
271 SearchResults m_searchResults; 273 SearchResults m_searchResults;
272 OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask; 274 OwnPtr<RevalidateStyleAttributeTask> m_revalidateStyleAttrTask;
273 SearchMode m_searchingForNode; 275 SearchMode m_searchingForNode;
274 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig; 276 OwnPtr<HighlightConfig> m_inspectModeHighlightConfig;
275 OwnPtrWillBePersistent<InspectorHistory> m_history; 277 OwnPtrWillBeMember<InspectorHistory> m_history;
276 OwnPtrWillBePersistent<DOMEditor> m_domEditor; 278 OwnPtrWillBeMember<DOMEditor> m_domEditor;
277 bool m_suppressAttributeModifiedEvent; 279 bool m_suppressAttributeModifiedEvent;
278 Listener* m_listener; 280 RawPtrWillBeMember<Listener> m_listener;
279 }; 281 };
280 282
281 283
282 } // namespace WebCore 284 } // namespace WebCore
283 285
284 #endif // !defined(InspectorDOMAgent_h) 286 #endif // !defined(InspectorDOMAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698