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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMetaElement-in.cpp

Issue 2258033002: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. Created 4 years, 4 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, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 // skip to first separator 118 // skip to first separator
119 while (!isSeparator(buffer[i])) { 119 while (!isSeparator(buffer[i])) {
120 error |= isInvalidSeparator(buffer[i]); 120 error |= isInvalidSeparator(buffer[i]);
121 if (i >= length) 121 if (i >= length)
122 break; 122 break;
123 i++; 123 i++;
124 } 124 }
125 valueEnd = i; 125 valueEnd = i;
126 126
127 ASSERT_WITH_SECURITY_IMPLICATION(i <= length); 127 SECURITY_DCHECK(i <= length);
128 128
129 String keyString = buffer.substring(keyBegin, keyEnd - keyBegin); 129 String keyString = buffer.substring(keyBegin, keyEnd - keyBegin);
130 String valueString = buffer.substring(valueBegin, valueEnd - valueBegin) ; 130 String valueString = buffer.substring(valueBegin, valueEnd - valueBegin) ;
131 processViewportKeyValuePair(document, keyString, valueString, viewportMe taZeroValuesQuirk, data); 131 processViewportKeyValuePair(document, keyString, valueString, viewportMe taZeroValuesQuirk, data);
132 } 132 }
133 if (error && document) { 133 if (error && document) {
134 String message = "Error parsing a meta element's content: ';' is not a v alid key-value pair separator. Please use ',' instead."; 134 String message = "Error parsing a meta element's content: ';' is not a v alid key-value pair separator. Please use ',' instead.";
135 document->addConsoleMessage(ConsoleMessage::create(RenderingMessageSourc e, WarningMessageLevel, message)); 135 document->addConsoleMessage(ConsoleMessage::create(RenderingMessageSourc e, WarningMessageLevel, message));
136 } 136 }
137 } 137 }
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 { 377 {
378 switch (errorCode) { 378 switch (errorCode) {
379 case TruncatedViewportArgumentValueError: 379 case TruncatedViewportArgumentValueError:
380 case TargetDensityDpiUnsupported: 380 case TargetDensityDpiUnsupported:
381 case UnrecognizedViewportArgumentKeyError: 381 case UnrecognizedViewportArgumentKeyError:
382 case UnrecognizedViewportArgumentValueError: 382 case UnrecognizedViewportArgumentValueError:
383 case MaximumScaleTooLargeError: 383 case MaximumScaleTooLargeError:
384 return WarningMessageLevel; 384 return WarningMessageLevel;
385 } 385 }
386 386
387 ASSERT_NOT_REACHED(); 387 NOTREACHED();
388 return ErrorMessageLevel; 388 return ErrorMessageLevel;
389 } 389 }
390 390
391 void HTMLMetaElement::reportViewportWarning(Document* document, ViewportErrorCod e errorCode, const String& replacement1, const String& replacement2) 391 void HTMLMetaElement::reportViewportWarning(Document* document, ViewportErrorCod e errorCode, const String& replacement1, const String& replacement2)
392 { 392 {
393 if (!document || !document->frame()) 393 if (!document || !document->frame())
394 return; 394 return;
395 395
396 String message = viewportErrorMessageTemplate(errorCode); 396 String message = viewportErrorMessageTemplate(errorCode);
397 if (!replacement1.isNull()) 397 if (!replacement1.isNull())
(...skipping 12 matching lines...) Expand all
410 if (description.minZoom == ViewportDescription::ValueAuto) 410 if (description.minZoom == ViewportDescription::ValueAuto)
411 description.minZoom = 0.25; 411 description.minZoom = 0.25;
412 412
413 if (description.maxZoom == ViewportDescription::ValueAuto) { 413 if (description.maxZoom == ViewportDescription::ValueAuto) {
414 description.maxZoom = 5; 414 description.maxZoom = 5;
415 description.minZoom = std::min(description.minZoom, float(5)); 415 description.minZoom = std::min(description.minZoom, float(5));
416 } 416 }
417 } 417 }
418 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie wportDescription::Type origin) 418 void HTMLMetaElement::processViewportContentAttribute(const String& content, Vie wportDescription::Type origin)
419 { 419 {
420 ASSERT(!content.isNull()); 420 DCHECK(!content.isNull());
421 421
422 if (!document().shouldOverrideLegacyDescription(origin)) 422 if (!document().shouldOverrideLegacyDescription(origin))
423 return; 423 return;
424 424
425 ViewportDescription descriptionFromLegacyTag(origin); 425 ViewportDescription descriptionFromLegacyTag(origin);
426 if (document().shouldMergeWithLegacyDescription(origin)) 426 if (document().shouldMergeWithLegacyDescription(origin))
427 descriptionFromLegacyTag = document().viewportDescription(); 427 descriptionFromLegacyTag = document().viewportDescription();
428 428
429 getViewportDescriptionFromContentAttribute(content, descriptionFromLegacyTag , &document(), document().settings() && document().settings()->viewportMetaZeroV aluesQuirk()); 429 getViewportDescriptionFromContentAttribute(content, descriptionFromLegacyTag , &document(), document().settings() && document().settings()->viewportMetaZeroV aluesQuirk());
430 430
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 { 514 {
515 return getAttribute(http_equivAttr); 515 return getAttribute(http_equivAttr);
516 } 516 }
517 517
518 const AtomicString& HTMLMetaElement::name() const 518 const AtomicString& HTMLMetaElement::name() const
519 { 519 {
520 return getNameAttribute(); 520 return getNameAttribute();
521 } 521 }
522 522
523 } 523 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMapElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLMeterElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698