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

Side by Side Diff: third_party/WebKit/Source/core/page/PrintContext.cpp

Issue 2858963002: Replace ASSERT with DCHECK in core/ (Closed)
Patch Set: WorkerBackingThread 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 2 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
3 * Copyright (C) 2007 Apple Inc. 3 * Copyright (C) 2007 Apple Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 height * kPrintingMinimumShrinkFactor)); 164 height * kPrintingMinimumShrinkFactor));
165 165
166 // This changes layout, so callers need to make sure that they don't paint to 166 // This changes layout, so callers need to make sure that they don't paint to
167 // screen while in printing mode. 167 // screen while in printing mode.
168 frame_->SetPrinting( 168 frame_->SetPrinting(
169 true, min_layout_size, original_page_size, 169 true, min_layout_size, original_page_size,
170 kPrintingMaximumShrinkFactor / kPrintingMinimumShrinkFactor); 170 kPrintingMaximumShrinkFactor / kPrintingMinimumShrinkFactor);
171 } 171 }
172 172
173 void PrintContext::EndPrintMode() { 173 void PrintContext::EndPrintMode() {
174 ASSERT(is_printing_); 174 DCHECK(is_printing_);
175 is_printing_ = false; 175 is_printing_ = false;
176 if (IsFrameValid()) 176 if (IsFrameValid())
177 frame_->SetPrinting(false, FloatSize(), FloatSize(), 0); 177 frame_->SetPrinting(false, FloatSize(), FloatSize(), 0);
178 linked_destinations_.clear(); 178 linked_destinations_.clear();
179 linked_destinations_valid_ = false; 179 linked_destinations_valid_ = false;
180 } 180 }
181 181
182 // static 182 // static
183 int PrintContext::PageNumberForElement(Element* element, 183 int PrintContext::PageNumberForElement(Element* element,
184 const FloatSize& page_size_in_pixels) { 184 const FloatSize& page_size_in_pixels) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 337 }
338 338
339 ScopedPrintContext::ScopedPrintContext(LocalFrame* frame) 339 ScopedPrintContext::ScopedPrintContext(LocalFrame* frame)
340 : context_(new PrintContext(frame)) {} 340 : context_(new PrintContext(frame)) {}
341 341
342 ScopedPrintContext::~ScopedPrintContext() { 342 ScopedPrintContext::~ScopedPrintContext() {
343 context_->EndPrintMode(); 343 context_->EndPrintMode();
344 } 344 }
345 345
346 } // namespace blink 346 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/PagePopupSupplement.cpp ('k') | third_party/WebKit/Source/core/page/SpatialNavigation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698