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

Unified Diff: third_party/WebKit/public/web/WebFrameContentDumper.h

Issue 1672073003: Shunt string-dumping functions from WebFrame to a side class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added/updated TODOs. Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/public/web/WebFrame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/web/WebFrameContentDumper.h
diff --git a/third_party/WebKit/public/web/WebFrameContentDumper.h b/third_party/WebKit/public/web/WebFrameContentDumper.h
new file mode 100644
index 0000000000000000000000000000000000000000..a1e3f65b7d411da024944873571cefa5f7cd4f61
--- /dev/null
+++ b/third_party/WebKit/public/web/WebFrameContentDumper.h
@@ -0,0 +1,50 @@
+// Copyright 2016 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.
+
+#ifndef WebFrameContentDumper_h
+#define WebFrameContentDumper_h
+
+#include "public/platform/WebCommon.h"
+
+namespace blink {
+
+class WebLocalFrame;
+class WebString;
+
+// Functions in this class should only be used for
+// testing purposes.
+// The exceptions to this rule are tracked in http://crbug.com/585164.
+class WebFrameContentDumper {
+public:
+ // Control of layoutTreeAsText output
+ enum LayoutAsTextControl {
+ LayoutAsTextNormal = 0,
+ LayoutAsTextDebug = 1 << 0,
+ LayoutAsTextPrinting = 1 << 1,
+ LayoutAsTextWithLineTrees = 1 << 2
+ };
+ typedef unsigned LayoutAsTextControls;
+
+ // Returns the contents of this frame as a string. If the text is
+ // longer than maxChars, it will be clipped to that length. WARNING:
+ // This function may be slow depending on the number of characters
+ // retrieved and page complexity. For a typically sized page, expect
+ // it to take on the order of milliseconds.
+ //
+ // If there is room, subframe text will be recursively appended. Each
+ // frame will be separated by an empty line.
+ BLINK_EXPORT static WebString dumpFrameTreeAsText(WebLocalFrame*, size_t maxChars);
+
+ // Returns HTML text for the contents of this frame, generated
+ // from the DOM.
+ BLINK_EXPORT static WebString dumpAsMarkup(WebLocalFrame*);
+
+ // Returns a text representation of the render tree. This method is used
+ // to support layout tests.
+ BLINK_EXPORT static WebString dumpLayoutTreeAsText(WebLocalFrame*, LayoutAsTextControls toShow = LayoutAsTextNormal);
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/public/web/WebFrame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698