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

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

Issue 1118963002: Revert of DevTools: remove dependency of most agents on InspectorPageAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 class Document; 53 class Document;
54 class DocumentLoader; 54 class DocumentLoader;
55 class Element; 55 class Element;
56 class EventTarget; 56 class EventTarget;
57 class ExceptionState; 57 class ExceptionState;
58 class FloatQuad; 58 class FloatQuad;
59 class InsertionPoint; 59 class InsertionPoint;
60 class InspectorFrontend; 60 class InspectorFrontend;
61 class InspectorHistory; 61 class InspectorHistory;
62 class InspectorOverlay; 62 class InspectorOverlay;
63 class InspectorPageAgent;
63 class Node; 64 class Node;
64 class QualifiedName; 65 class QualifiedName;
65 class PseudoElement; 66 class PseudoElement;
66 class PlatformGestureEvent; 67 class PlatformGestureEvent;
67 class PlatformMouseEvent; 68 class PlatformMouseEvent;
68 class PlatformTouchEvent; 69 class PlatformTouchEvent;
69 class InspectorRevalidateDOMTask; 70 class InspectorRevalidateDOMTask;
70 class ShadowRoot; 71 class ShadowRoot;
71 72
72 struct InspectorHighlightConfig; 73 struct InspectorHighlightConfig;
73 74
74 typedef String ErrorString; 75 typedef String ErrorString;
75 76
76 class InspectorDOMAgent final : public InspectorBaseAgent<InspectorDOMAgent, Ins pectorFrontend::DOM>, public InspectorBackendDispatcher::DOMCommandHandler { 77 class InspectorDOMAgent final : public InspectorBaseAgent<InspectorDOMAgent, Ins pectorFrontend::DOM>, public InspectorBackendDispatcher::DOMCommandHandler {
77 WTF_MAKE_NONCOPYABLE(InspectorDOMAgent); 78 WTF_MAKE_NONCOPYABLE(InspectorDOMAgent);
78 public: 79 public:
79 struct DOMListener : public WillBeGarbageCollectedMixin { 80 struct DOMListener : public WillBeGarbageCollectedMixin {
80 virtual ~DOMListener() 81 virtual ~DOMListener()
81 { 82 {
82 } 83 }
83 virtual void didRemoveDocument(Document*) = 0; 84 virtual void didRemoveDocument(Document*) = 0;
84 virtual void didRemoveDOMNode(Node*) = 0; 85 virtual void didRemoveDOMNode(Node*) = 0;
85 virtual void didModifyDOMAttr(Element*) = 0; 86 virtual void didModifyDOMAttr(Element*) = 0;
86 }; 87 };
87 88
88 static PassOwnPtrWillBeRawPtr<InspectorDOMAgent> create(LocalFrame* inspecte dFrame, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overlay) 89 static PassOwnPtrWillBeRawPtr<InspectorDOMAgent> create(InspectorPageAgent* pageAgent, InjectedScriptManager* injectedScriptManager, InspectorOverlay* overl ay)
89 { 90 {
90 return adoptPtrWillBeNoop(new InspectorDOMAgent(inspectedFrame, injected ScriptManager, overlay)); 91 return adoptPtrWillBeNoop(new InspectorDOMAgent(pageAgent, injectedScrip tManager, overlay));
91 } 92 }
92 93
93 static String toErrorString(ExceptionState&); 94 static String toErrorString(ExceptionState&);
94 static bool getPseudoElementType(PseudoId, TypeBuilder::DOM::PseudoType::Enu m*); 95 static bool getPseudoElementType(PseudoId, TypeBuilder::DOM::PseudoType::Enu m*);
95 96
96 virtual ~InspectorDOMAgent(); 97 virtual ~InspectorDOMAgent();
97 DECLARE_VIRTUAL_TRACE(); 98 DECLARE_VIRTUAL_TRACE();
98 99
99 void disable(ErrorString*) override; 100 void disable(ErrorString*) override;
100 void restore() override; 101 void restore() override;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 static Node* innerParentNode(Node*); 199 static Node* innerParentNode(Node*);
199 static bool isWhitespace(Node*); 200 static bool isWhitespace(Node*);
200 201
201 Node* assertNode(ErrorString*, int nodeId); 202 Node* assertNode(ErrorString*, int nodeId);
202 Element* assertElement(ErrorString*, int nodeId); 203 Element* assertElement(ErrorString*, int nodeId);
203 Document* assertDocument(ErrorString*, int nodeId); 204 Document* assertDocument(ErrorString*, int nodeId);
204 205
205 private: 206 private:
206 enum SearchMode { NotSearching, SearchingForNormal, SearchingForUAShadow }; 207 enum SearchMode { NotSearching, SearchingForNormal, SearchingForUAShadow };
207 208
208 InspectorDOMAgent(LocalFrame*, InjectedScriptManager*, InspectorOverlay*); 209 InspectorDOMAgent(InspectorPageAgent*, InjectedScriptManager*, InspectorOver lay*);
209 210
210 void setDocument(Document*); 211 void setDocument(Document*);
211 void innerEnable(); 212 void innerEnable();
212 213
213 void setSearchingForNode(ErrorString*, SearchMode, JSONObject* highlightConf ig); 214 void setSearchingForNode(ErrorString*, SearchMode, JSONObject* highlightConf ig);
214 PassOwnPtr<InspectorHighlightConfig> highlightConfigFromInspectorObject(Erro rString*, JSONObject* highlightInspectorObject); 215 PassOwnPtr<InspectorHighlightConfig> highlightConfigFromInspectorObject(Erro rString*, JSONObject* highlightInspectorObject);
215 216
216 // Node-related methods. 217 // Node-related methods.
217 typedef WillBeHeapHashMap<RefPtrWillBeMember<Node>, int> NodeToIdMap; 218 typedef WillBeHeapHashMap<RefPtrWillBeMember<Node>, int> NodeToIdMap;
218 int bind(Node*, NodeToIdMap*); 219 int bind(Node*, NodeToIdMap*);
(...skipping 19 matching lines...) Expand all
238 Node* nodeForPath(const String& path); 239 Node* nodeForPath(const String& path);
239 240
240 void discardFrontendBindings(); 241 void discardFrontendBindings();
241 242
242 void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* col or, const RefPtr<JSONObject>* outlineColor); 243 void innerHighlightQuad(PassOwnPtr<FloatQuad>, const RefPtr<JSONObject>* col or, const RefPtr<JSONObject>* outlineColor);
243 244
244 bool pushDocumentUponHandlelessOperation(ErrorString*); 245 bool pushDocumentUponHandlelessOperation(ErrorString*);
245 246
246 RawPtrWillBeMember<InspectorRevalidateDOMTask> revalidateTask(); 247 RawPtrWillBeMember<InspectorRevalidateDOMTask> revalidateTask();
247 248
248 RawPtrWillBeMember<LocalFrame> m_inspectedFrame; 249 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent;
249 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; 250 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager;
250 RawPtrWillBeMember<InspectorOverlay> m_overlay; 251 RawPtrWillBeMember<InspectorOverlay> m_overlay;
251 RawPtrWillBeMember<DOMListener> m_domListener; 252 RawPtrWillBeMember<DOMListener> m_domListener;
252 OwnPtrWillBeMember<NodeToIdMap> m_documentNodeToIdMap; 253 OwnPtrWillBeMember<NodeToIdMap> m_documentNodeToIdMap;
253 // Owns node mappings for dangling nodes. 254 // Owns node mappings for dangling nodes.
254 WillBeHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeToIdMaps; 255 WillBeHeapVector<OwnPtrWillBeMember<NodeToIdMap> > m_danglingNodeToIdMaps;
255 WillBeHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode; 256 WillBeHeapHashMap<int, RawPtrWillBeMember<Node> > m_idToNode;
256 WillBeHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNodesMap; 257 WillBeHeapHashMap<int, RawPtrWillBeMember<NodeToIdMap> > m_idToNodesMap;
257 HashSet<int> m_childrenRequested; 258 HashSet<int> m_childrenRequested;
258 HashSet<int> m_distributedNodesRequested; 259 HashSet<int> m_distributedNodesRequested;
(...skipping 10 matching lines...) Expand all
269 OwnPtrWillBeMember<DOMEditor> m_domEditor; 270 OwnPtrWillBeMember<DOMEditor> m_domEditor;
270 bool m_suppressAttributeModifiedEvent; 271 bool m_suppressAttributeModifiedEvent;
271 RawPtrWillBeMember<Listener> m_listener; 272 RawPtrWillBeMember<Listener> m_listener;
272 int m_backendNodeIdToInspect; 273 int m_backendNodeIdToInspect;
273 }; 274 };
274 275
275 276
276 } // namespace blink 277 } // namespace blink
277 278
278 #endif // !defined(InspectorDOMAgent_h) 279 #endif // !defined(InspectorDOMAgent_h)
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorCSSAgent.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698