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

Side by Side Diff: third_party/WebKit/Source/core/css/MediaQueryExp.cpp

Issue 2755493004: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ (Closed)
Patch Set: Worked on Review Comments done Created 3 years, 9 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 * CSS Media Query 2 * CSS Media Query
3 * 3 *
4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * Copyright (C) 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2013 Apple Inc. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 MediaQueryExp::MediaQueryExp(const MediaQueryExp& other) 212 MediaQueryExp::MediaQueryExp(const MediaQueryExp& other)
213 : m_mediaFeature(other.mediaFeature()), m_expValue(other.expValue()) {} 213 : m_mediaFeature(other.mediaFeature()), m_expValue(other.expValue()) {}
214 214
215 MediaQueryExp::MediaQueryExp(const String& mediaFeature, 215 MediaQueryExp::MediaQueryExp(const String& mediaFeature,
216 const MediaQueryExpValue& expValue) 216 const MediaQueryExpValue& expValue)
217 : m_mediaFeature(mediaFeature), m_expValue(expValue) {} 217 : m_mediaFeature(mediaFeature), m_expValue(expValue) {}
218 218
219 MediaQueryExp* MediaQueryExp::createIfValid( 219 MediaQueryExp* MediaQueryExp::createIfValid(
220 const String& mediaFeature, 220 const String& mediaFeature,
221 const Vector<CSSParserToken, 4>& tokenList) { 221 const Vector<CSSParserToken, 4>& tokenList) {
222 ASSERT(!mediaFeature.isNull()); 222 DCHECK(!mediaFeature.isNull());
223 223
224 MediaQueryExpValue expValue; 224 MediaQueryExpValue expValue;
225 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower()); 225 String lowerMediaFeature = attemptStaticStringCreation(mediaFeature.lower());
226 226
227 // Create value for media query expression that must have 1 or more values. 227 // Create value for media query expression that must have 1 or more values.
228 if (tokenList.size() == 0 && featureWithoutValue(lowerMediaFeature)) { 228 if (tokenList.size() == 0 && featureWithoutValue(lowerMediaFeature)) {
229 // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue 229 // Valid, creates a MediaQueryExp with an 'invalid' MediaQueryExpValue
230 } else if (tokenList.size() == 1) { 230 } else if (tokenList.size() == 1) {
231 CSSParserToken token = tokenList.front(); 231 CSSParserToken token = tokenList.front();
232 232
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 output.append('/'); 325 output.append('/');
326 output.append(printNumber(denominator)); 326 output.append(printNumber(denominator));
327 } else if (isID) { 327 } else if (isID) {
328 output.append(getValueName(id)); 328 output.append(getValueName(id));
329 } 329 }
330 330
331 return output.toString(); 331 return output.toString();
332 } 332 }
333 333
334 } // namespace blink 334 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698