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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp

Issue 2864753004: M59: Clear the PrintContext in WebLocalFrameImpl::Close(). (Closed)
Patch Set: fix Created 3 years, 7 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 | « no previous file | third_party/WebKit/Source/core/page/PrintContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp b/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
index 4b3a42362b633b4b2c19c5b15b78175ffc3315f8..cb53150f2e5e31387989e45582d80afdae00758d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
@@ -818,13 +818,17 @@ String ExternalRepresentation(LocalFrame* frame,
return String();
PrintContext print_context(frame);
- if (behavior & kLayoutAsTextPrintingMode) {
+ bool is_text_printing_mode = !!(behavior & kLayoutAsTextPrintingMode);
+ if (is_text_printing_mode) {
FloatSize size(ToLayoutBox(layout_object)->Size());
print_context.begin(size.Width(), size.Height());
}
- return ExternalRepresentation(ToLayoutBox(layout_object), behavior,
- marked_layer);
+ String representation = ExternalRepresentation(ToLayoutBox(layout_object),
+ behavior, marked_layer);
+ if (is_text_printing_mode)
+ print_context.end();
+ return representation;
}
String ExternalRepresentation(Element* element, LayoutAsTextBehavior behavior) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/PrintContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698