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

Side by Side Diff: third_party/WebKit/Source/platform/Length.cpp

Issue 2849903002: Replace ASSERT_NOT_REACHED with NOTREACHED in platform/ (Closed)
Patch Set: rebase 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller ( mueller@kde.org ) 4 * (C) 2001 Dirk Mueller ( mueller@kde.org )
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 7 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 PixelsAndPercent Length::GetPixelsAndPercent() const { 106 PixelsAndPercent Length::GetPixelsAndPercent() const {
107 switch (GetType()) { 107 switch (GetType()) {
108 case kFixed: 108 case kFixed:
109 return PixelsAndPercent(Value(), 0); 109 return PixelsAndPercent(Value(), 0);
110 case kPercent: 110 case kPercent:
111 return PixelsAndPercent(0, Value()); 111 return PixelsAndPercent(0, Value());
112 case kCalculated: 112 case kCalculated:
113 return GetCalculationValue().GetPixelsAndPercent(); 113 return GetCalculationValue().GetPixelsAndPercent();
114 default: 114 default:
115 ASSERT_NOT_REACHED(); 115 NOTREACHED();
116 return PixelsAndPercent(0, 0); 116 return PixelsAndPercent(0, 0);
117 } 117 }
118 } 118 }
119 119
120 Length Length::SubtractFromOneHundredPercent() const { 120 Length Length::SubtractFromOneHundredPercent() const {
121 PixelsAndPercent result = GetPixelsAndPercent(); 121 PixelsAndPercent result = GetPixelsAndPercent();
122 result.pixels = -result.pixels; 122 result.pixels = -result.pixels;
123 result.percent = 100 - result.percent; 123 result.percent = 100 - result.percent;
124 if (result.pixels && result.percent) 124 if (result.pixels && result.percent)
125 return Length(CalculationValue::Create(result, kValueRangeAll)); 125 return Length(CalculationValue::Create(result, kValueRangeAll));
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 } 173 }
174 174
175 struct SameSizeAsLength { 175 struct SameSizeAsLength {
176 int32_t value; 176 int32_t value;
177 int32_t meta_data; 177 int32_t meta_data;
178 }; 178 };
179 static_assert(sizeof(Length) == sizeof(SameSizeAsLength), 179 static_assert(sizeof(Length) == sizeof(SameSizeAsLength),
180 "length should stay small"); 180 "length should stay small");
181 181
182 } // namespace blink 182 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/Length.h ('k') | third_party/WebKit/Source/platform/LengthFunctions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698