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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2883353002: Replace ASSERT with DCHECK_LE/GE/GT/LT/NE as appropriate (Closed)
Patch Set: DCHECK in BluetoothCharacteristicProperties.cpp 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 } 636 }
637 637
638 FloatSize LocalFrame::ResizePageRectsKeepingRatio( 638 FloatSize LocalFrame::ResizePageRectsKeepingRatio(
639 const FloatSize& original_size, 639 const FloatSize& original_size,
640 const FloatSize& expected_size) { 640 const FloatSize& expected_size) {
641 FloatSize result_size; 641 FloatSize result_size;
642 if (ContentLayoutItem().IsNull()) 642 if (ContentLayoutItem().IsNull())
643 return FloatSize(); 643 return FloatSize();
644 644
645 if (ContentLayoutItem().Style()->IsHorizontalWritingMode()) { 645 if (ContentLayoutItem().Style()->IsHorizontalWritingMode()) {
646 ASSERT(fabs(original_size.Width()) > std::numeric_limits<float>::epsilon()); 646 DCHECK_GT(fabs(original_size.Width()),
647 std::numeric_limits<float>::epsilon());
647 float ratio = original_size.Height() / original_size.Width(); 648 float ratio = original_size.Height() / original_size.Width();
648 result_size.SetWidth(floorf(expected_size.Width())); 649 result_size.SetWidth(floorf(expected_size.Width()));
649 result_size.SetHeight(floorf(result_size.Width() * ratio)); 650 result_size.SetHeight(floorf(result_size.Width() * ratio));
650 } else { 651 } else {
651 ASSERT(fabs(original_size.Height()) > 652 ASSERT(fabs(original_size.Height()) >
Lei Zhang 2017/05/19 06:31:00 You missed a nearly identical one here. No worries
652 std::numeric_limits<float>::epsilon()); 653 std::numeric_limits<float>::epsilon());
653 float ratio = original_size.Width() / original_size.Height(); 654 float ratio = original_size.Width() / original_size.Height();
654 result_size.SetHeight(floorf(expected_size.Height())); 655 result_size.SetHeight(floorf(expected_size.Height()));
655 result_size.SetWidth(floorf(result_size.Height() * ratio)); 656 result_size.SetWidth(floorf(result_size.Height() * ratio));
656 } 657 }
657 return result_size; 658 return result_size;
658 } 659 }
659 660
660 void LocalFrame::SetPageZoomFactor(float factor) { 661 void LocalFrame::SetPageZoomFactor(float factor) {
661 SetPageAndTextZoomFactors(factor, text_zoom_factor_); 662 SetPageAndTextZoomFactors(factor, text_zoom_factor_);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 WebURLRequest::kClientLoFiOn); 969 WebURLRequest::kClientLoFiOn);
969 params.SetAllowImagePlaceholder(); 970 params.SetAllowImagePlaceholder();
970 } 971 }
971 } 972 }
972 973
973 std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() { 974 std::unique_ptr<WebURLLoader> LocalFrame::CreateURLLoader() {
974 return Client()->CreateURLLoader(); 975 return Client()->CreateURLLoader();
975 } 976 }
976 977
977 } // namespace blink 978 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmap.cpp ('k') | third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698