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

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

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