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

Side by Side Diff: headless/public/util/dom_tree_extractor.h

Issue 2673773002: Adds a FlatDomTreeExtractor to headless (Closed)
Patch Set: Fix DCHECKS Created 3 years, 10 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
« no previous file with comments | « headless/BUILD.gn ('k') | headless/public/util/flat_dom_tree_extractor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef HEADLESS_PUBLIC_UTIL_DOM_TREE_EXTRACTOR_H_ 5 #ifndef HEADLESS_PUBLIC_UTIL_DOM_TREE_EXTRACTOR_H_
6 #define HEADLESS_PUBLIC_UTIL_DOM_TREE_EXTRACTOR_H_ 6 #define HEADLESS_PUBLIC_UTIL_DOM_TREE_EXTRACTOR_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "headless/public/devtools/domains/css.h" 12 #include "headless/public/devtools/domains/css.h"
13 #include "headless/public/devtools/domains/dom.h" 13 #include "headless/public/devtools/domains/dom.h"
14 14
15 namespace headless { 15 namespace headless {
16 class HeadlessDevToolsClient; 16 class HeadlessDevToolsClient;
17 17
18 // A utility class for extracting information from the DOM via DevTools. In 18 // A utility class for extracting information from the DOM via DevTools. In
19 // addition, it also extracts details of bounding boxes and layout text (NB the 19 // addition, it also extracts details of bounding boxes and layout text (NB the
20 // exact layout should not be regarded as stable, it's subject to change without 20 // exact layout should not be regarded as stable, it's subject to change without
21 // notice). 21 // notice).
22 // TODO(alexclarke): Remove in favor of one using DOM.getFlattenedDocument.
22 class DomTreeExtractor { 23 class DomTreeExtractor {
23 public: 24 public:
24 explicit DomTreeExtractor(HeadlessDevToolsClient* devtools_client); 25 explicit DomTreeExtractor(HeadlessDevToolsClient* devtools_client);
25 ~DomTreeExtractor(); 26 ~DomTreeExtractor();
26 27
27 using NodeId = int; 28 using NodeId = int;
28 using Index = size_t; 29 using Index = size_t;
29 30
30 class DomTree { 31 class DomTree {
31 public: 32 public:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 bool work_in_progress_; 80 bool work_in_progress_;
80 HeadlessDevToolsClient* devtools_client_; // NOT OWNED 81 HeadlessDevToolsClient* devtools_client_; // NOT OWNED
81 base::WeakPtrFactory<DomTreeExtractor> weak_factory_; 82 base::WeakPtrFactory<DomTreeExtractor> weak_factory_;
82 83
83 DISALLOW_COPY_AND_ASSIGN(DomTreeExtractor); 84 DISALLOW_COPY_AND_ASSIGN(DomTreeExtractor);
84 }; 85 };
85 86
86 } // namespace headless 87 } // namespace headless
87 88
88 #endif // HEADLESS_PUBLIC_UTIL_DOM_TREE_EXTRACTOR_H_ 89 #endif // HEADLESS_PUBLIC_UTIL_DOM_TREE_EXTRACTOR_H_
OLDNEW
« no previous file with comments | « headless/BUILD.gn ('k') | headless/public/util/flat_dom_tree_extractor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698