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

Unified Diff: headless/public/util/flat_dom_tree_extractor.h

Issue 2673773002: Adds a FlatDomTreeExtractor to headless (Closed)
Patch Set: Fix DCHECKS Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/public/util/dom_tree_extractor.h ('k') | headless/public/util/flat_dom_tree_extractor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/util/flat_dom_tree_extractor.h
diff --git a/headless/public/util/dom_tree_extractor.h b/headless/public/util/flat_dom_tree_extractor.h
similarity index 81%
copy from headless/public/util/dom_tree_extractor.h
copy to headless/public/util/flat_dom_tree_extractor.h
index dcd08bfe91726e0ed8b799a166ad487fae7b2b76..14de70d8572e3911a44d7035cfc8fa2933edec12 100644
--- a/headless/public/util/dom_tree_extractor.h
+++ b/headless/public/util/flat_dom_tree_extractor.h
@@ -1,4 +1,4 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
+// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,10 +19,10 @@ class HeadlessDevToolsClient;
// addition, it also extracts details of bounding boxes and layout text (NB the
// exact layout should not be regarded as stable, it's subject to change without
// notice).
-class DomTreeExtractor {
+class FlatDomTreeExtractor {
public:
- explicit DomTreeExtractor(HeadlessDevToolsClient* devtools_client);
- ~DomTreeExtractor();
+ explicit FlatDomTreeExtractor(HeadlessDevToolsClient* devtools_client);
+ ~FlatDomTreeExtractor();
using NodeId = int;
using Index = size_t;
@@ -44,10 +44,10 @@ class DomTreeExtractor {
std::vector<const css::ComputedStyle*> computed_styles_;
private:
- friend class DomTreeExtractor;
+ friend class FlatDomTreeExtractor;
// Owns the raw pointers in |dom_nodes_|.
- std::unique_ptr<dom::GetDocumentResult> document_result_;
+ std::unique_ptr<dom::GetFlattenedDocumentResult> document_result_;
// Owns the raw pointers in |layout_tree_nodes_|.
std::unique_ptr<css::GetLayoutTreeAndStylesResult>
@@ -64,7 +64,8 @@ class DomTreeExtractor {
DomResultCB callback);
private:
- void OnDocumentFetched(std::unique_ptr<dom::GetDocumentResult> result);
+ void OnDocumentFetched(
+ std::unique_ptr<dom::GetFlattenedDocumentResult> result);
void OnLayoutTreeAndStylesFetched(
std::unique_ptr<css::GetLayoutTreeAndStylesResult> result);
@@ -78,9 +79,9 @@ class DomTreeExtractor {
DomTree dom_tree_;
bool work_in_progress_;
HeadlessDevToolsClient* devtools_client_; // NOT OWNED
- base::WeakPtrFactory<DomTreeExtractor> weak_factory_;
+ base::WeakPtrFactory<FlatDomTreeExtractor> weak_factory_;
- DISALLOW_COPY_AND_ASSIGN(DomTreeExtractor);
+ DISALLOW_COPY_AND_ASSIGN(FlatDomTreeExtractor);
};
} // namespace headless
« no previous file with comments | « headless/public/util/dom_tree_extractor.h ('k') | headless/public/util/flat_dom_tree_extractor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698