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 12 matching lines...) Expand all Loading... | |
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #ifndef InspectorDOMAgent_h | 30 #ifndef InspectorDOMAgent_h |
31 #define InspectorDOMAgent_h | 31 #define InspectorDOMAgent_h |
32 | 32 |
33 #include <unordered_map> | |
34 | |
33 #include "core/CoreExport.h" | 35 #include "core/CoreExport.h" |
34 #include "core/events/EventListenerMap.h" | 36 #include "core/events/EventListenerMap.h" |
35 #include "core/inspector/InspectorBaseAgent.h" | 37 #include "core/inspector/InspectorBaseAgent.h" |
36 #include "core/inspector/InspectorHighlight.h" | 38 #include "core/inspector/InspectorHighlight.h" |
37 #include "core/inspector/protocol/DOM.h" | 39 #include "core/inspector/protocol/DOM.h" |
38 #include "core/style/ComputedStyleConstants.h" | 40 #include "core/style/ComputedStyleConstants.h" |
39 #include "platform/geometry/FloatQuad.h" | 41 #include "platform/geometry/FloatQuad.h" |
40 #include "wtf/HashMap.h" | 42 #include "wtf/HashMap.h" |
41 #include "wtf/HashSet.h" | 43 #include "wtf/HashSet.h" |
42 #include "wtf/RefPtr.h" | 44 #include "wtf/RefPtr.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 HeapVector<Member<Document>> documents(); | 119 HeapVector<Member<Document>> documents(); |
118 void reset(); | 120 void reset(); |
119 | 121 |
120 // Methods called from the frontend for DOM nodes inspection. | 122 // Methods called from the frontend for DOM nodes inspection. |
121 void enable(ErrorString*) override; | 123 void enable(ErrorString*) override; |
122 void disable(ErrorString*) override; | 124 void disable(ErrorString*) override; |
123 void getDocument(ErrorString*, | 125 void getDocument(ErrorString*, |
124 std::unique_ptr<protocol::DOM::Node>* root) override; | 126 std::unique_ptr<protocol::DOM::Node>* root) override; |
125 void getLayoutTreeNodes( | 127 void getLayoutTreeNodes( |
126 ErrorString*, | 128 ErrorString*, |
129 std::unique_ptr<protocol::Array<String>> style_whitelist, | |
127 std::unique_ptr<protocol::Array<protocol::DOM::LayoutTreeNode>>* | 130 std::unique_ptr<protocol::Array<protocol::DOM::LayoutTreeNode>>* |
128 layoutTreeNodes) override; | 131 layout_tree_nodes, |
132 std::unique_ptr<protocol::Array<protocol::DOM::ComputedStyle>>* | |
133 computed_styles) override; | |
129 void collectClassNamesFromSubtree( | 134 void collectClassNamesFromSubtree( |
130 ErrorString*, | 135 ErrorString*, |
131 int nodeId, | 136 int nodeId, |
132 std::unique_ptr<protocol::Array<String>>* classNames) override; | 137 std::unique_ptr<protocol::Array<String>>* classNames) override; |
133 void requestChildNodes(ErrorString*, | 138 void requestChildNodes(ErrorString*, |
134 int nodeId, | 139 int nodeId, |
135 const Maybe<int>& depth) override; | 140 const Maybe<int>& depth) override; |
136 void querySelector(ErrorString*, | 141 void querySelector(ErrorString*, |
137 int nodeId, | 142 int nodeId, |
138 const String& selector, | 143 const String& selector, |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 void discardFrontendBindings(); | 353 void discardFrontendBindings(); |
349 | 354 |
350 void innerHighlightQuad(std::unique_ptr<FloatQuad>, | 355 void innerHighlightQuad(std::unique_ptr<FloatQuad>, |
351 const Maybe<protocol::DOM::RGBA>& color, | 356 const Maybe<protocol::DOM::RGBA>& color, |
352 const Maybe<protocol::DOM::RGBA>& outlineColor); | 357 const Maybe<protocol::DOM::RGBA>& outlineColor); |
353 | 358 |
354 bool pushDocumentUponHandlelessOperation(ErrorString*); | 359 bool pushDocumentUponHandlelessOperation(ErrorString*); |
355 | 360 |
356 Member<InspectorRevalidateDOMTask> revalidateTask(); | 361 Member<InspectorRevalidateDOMTask> revalidateTask(); |
357 | 362 |
358 void visitLayoutTreeNodes(Node*, | 363 using ComputedStyleArray = |
359 protocol::Array<protocol::DOM::LayoutTreeNode>&); | 364 std::vector<std::unique_ptr<blink::protocol::DOM::ComputedStyleProperty>>; |
365 | |
366 using ComputedStylesMap = std::unordered_map<ComputedStyleArray, int>; | |
367 | |
368 void visitLayoutTreeNodes( | |
369 Node* node, | |
370 protocol::Array<protocol::DOM::LayoutTreeNode>& layout_tree_nodes, | |
dgozman
2016/10/12 21:00:40
blink uses camelCaseNames for now.
alex clarke (OOO till 29th)
2016/10/13 20:25:10
OK :(
| |
371 protocol::Array<String>* style_whitelist, | |
372 ComputedStylesMap& style_to_index_map); | |
373 | |
374 int getStyleIndexForNode(Node* node, | |
375 protocol::Array<String>* style_whitelist, | |
376 ComputedStylesMap& style_to_index_map); | |
360 | 377 |
361 v8::Isolate* m_isolate; | 378 v8::Isolate* m_isolate; |
362 Member<InspectedFrames> m_inspectedFrames; | 379 Member<InspectedFrames> m_inspectedFrames; |
363 v8_inspector::V8InspectorSession* m_v8Session; | 380 v8_inspector::V8InspectorSession* m_v8Session; |
364 Client* m_client; | 381 Client* m_client; |
365 Member<DOMListener> m_domListener; | 382 Member<DOMListener> m_domListener; |
366 Member<NodeToIdMap> m_documentNodeToIdMap; | 383 Member<NodeToIdMap> m_documentNodeToIdMap; |
367 // Owns node mappings for dangling nodes. | 384 // Owns node mappings for dangling nodes. |
368 HeapVector<Member<NodeToIdMap>> m_danglingNodeToIdMaps; | 385 HeapVector<Member<NodeToIdMap>> m_danglingNodeToIdMaps; |
369 HeapHashMap<int, Member<Node>> m_idToNode; | 386 HeapHashMap<int, Member<Node>> m_idToNode; |
370 HeapHashMap<int, Member<NodeToIdMap>> m_idToNodesMap; | 387 HeapHashMap<int, Member<NodeToIdMap>> m_idToNodesMap; |
371 HashSet<int> m_childrenRequested; | 388 HashSet<int> m_childrenRequested; |
372 HashSet<int> m_distributedNodesRequested; | 389 HashSet<int> m_distributedNodesRequested; |
373 HashMap<int, int> m_cachedChildCount; | 390 HashMap<int, int> m_cachedChildCount; |
374 int m_lastNodeId; | 391 int m_lastNodeId; |
375 Member<Document> m_document; | 392 Member<Document> m_document; |
376 typedef HeapHashMap<String, HeapVector<Member<Node>>> SearchResults; | 393 typedef HeapHashMap<String, HeapVector<Member<Node>>> SearchResults; |
377 SearchResults m_searchResults; | 394 SearchResults m_searchResults; |
378 Member<InspectorRevalidateDOMTask> m_revalidateTask; | 395 Member<InspectorRevalidateDOMTask> m_revalidateTask; |
379 Member<InspectorHistory> m_history; | 396 Member<InspectorHistory> m_history; |
380 Member<DOMEditor> m_domEditor; | 397 Member<DOMEditor> m_domEditor; |
381 bool m_suppressAttributeModifiedEvent; | 398 bool m_suppressAttributeModifiedEvent; |
382 int m_backendNodeIdToInspect; | 399 int m_backendNodeIdToInspect; |
383 }; | 400 }; |
384 | 401 |
385 } // namespace blink | 402 } // namespace blink |
386 | 403 |
387 #endif // !defined(InspectorDOMAgent_h) | 404 #endif // !defined(InspectorDOMAgent_h) |
OLD | NEW |