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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/page/PrintContextTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 return ToWebPluginContainerImpl(WebNode::PluginContainerFromNode(node)); 268 return ToWebPluginContainerImpl(WebNode::PluginContainerFromNode(node));
269 } 269 }
270 270
271 // Simple class to override some of PrintContext behavior. Some of the methods 271 // Simple class to override some of PrintContext behavior. Some of the methods
272 // made virtual so that they can be overridden by ChromePluginPrintContext. 272 // made virtual so that they can be overridden by ChromePluginPrintContext.
273 class ChromePrintContext : public PrintContext { 273 class ChromePrintContext : public PrintContext {
274 WTF_MAKE_NONCOPYABLE(ChromePrintContext); 274 WTF_MAKE_NONCOPYABLE(ChromePrintContext);
275 275
276 public: 276 public:
277 ChromePrintContext(LocalFrame* frame) 277 explicit ChromePrintContext(LocalFrame* frame)
278 : PrintContext(frame), printed_page_width_(0) {} 278 : PrintContext(frame), printed_page_width_(0) {}
279 279
280 ~ChromePrintContext() override {} 280 ~ChromePrintContext() override {}
281 281
282 virtual void begin(float width, float height) { 282 virtual void begin(float width, float height) {
283 DCHECK(!printed_page_width_); 283 DCHECK(!printed_page_width_);
284 printed_page_width_ = width; 284 printed_page_width_ = width;
285 printed_page_height_ = height; 285 printed_page_height_ = height;
286 PrintContext::begin(printed_page_width_, height); 286 PrintContext::begin(printed_page_width_, height);
287 } 287 }
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 548
549 void WebLocalFrameImpl::Close() { 549 void WebLocalFrameImpl::Close() {
550 WebLocalFrame::Close(); 550 WebLocalFrame::Close();
551 551
552 client_ = nullptr; 552 client_ = nullptr;
553 553
554 if (dev_tools_agent_) 554 if (dev_tools_agent_)
555 dev_tools_agent_.Clear(); 555 dev_tools_agent_.Clear();
556 556
557 self_keep_alive_.Clear(); 557 self_keep_alive_.Clear();
558
559 if (print_context_)
560 PrintEnd();
558 } 561 }
559 562
560 WebString WebLocalFrameImpl::AssignedName() const { 563 WebString WebLocalFrameImpl::AssignedName() const {
561 return GetFrame()->Tree().GetName(); 564 return GetFrame()->Tree().GetName();
562 } 565 }
563 566
564 void WebLocalFrameImpl::SetName(const WebString& name) { 567 void WebLocalFrameImpl::SetName(const WebString& name) {
565 GetFrame()->Tree().SetName(name); 568 GetFrame()->Tree().SetName(name);
566 } 569 }
567 570
(...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const { 2570 TextCheckerClient& WebLocalFrameImpl::GetTextCheckerClient() const {
2568 return *text_checker_client_; 2571 return *text_checker_client_;
2569 } 2572 }
2570 2573
2571 void WebLocalFrameImpl::SetTextCheckClient( 2574 void WebLocalFrameImpl::SetTextCheckClient(
2572 WebTextCheckClient* text_check_client) { 2575 WebTextCheckClient* text_check_client) {
2573 text_check_client_ = text_check_client; 2576 text_check_client_ = text_check_client;
2574 } 2577 }
2575 2578
2576 } // namespace blink 2579 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/PrintContextTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698