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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLObjectElement.h

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 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 }; 110 };
111 111
112 // Intentionally left unimplemented, template specialization needs to be provide d for specific 112 // Intentionally left unimplemented, template specialization needs to be provide d for specific
113 // return types. 113 // return types.
114 template<typename T> inline const T& toElement(const FormAssociatedElement&); 114 template<typename T> inline const T& toElement(const FormAssociatedElement&);
115 template<typename T> inline const T* toElement(const FormAssociatedElement*); 115 template<typename T> inline const T* toElement(const FormAssociatedElement*);
116 116
117 // Make toHTMLObjectElement() accept a FormAssociatedElement as input instead of a Node. 117 // Make toHTMLObjectElement() accept a FormAssociatedElement as input instead of a Node.
118 template<> inline const HTMLObjectElement* toElement<HTMLObjectElement>(const Fo rmAssociatedElement* element) 118 template<> inline const HTMLObjectElement* toElement<HTMLObjectElement>(const Fo rmAssociatedElement* element)
119 { 119 {
120 ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement( )); 120 SECURITY_DCHECK(!element || !element->isFormControlElement());
121 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement *>(element); 121 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement *>(element);
122 // We need to assert after the cast because FormAssociatedElement doesn't 122 // We need to assert after the cast because FormAssociatedElement doesn't
123 // have hasTagName. 123 // have hasTagName.
124 ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName (HTMLNames::objectTag)); 124 SECURITY_DCHECK(!objectElement || objectElement->hasTagName(HTMLNames::objec tTag));
125 return objectElement; 125 return objectElement;
126 } 126 }
127 127
128 template<> inline const HTMLObjectElement& toElement<HTMLObjectElement>(const Fo rmAssociatedElement& element) 128 template<> inline const HTMLObjectElement& toElement<HTMLObjectElement>(const Fo rmAssociatedElement& element)
129 { 129 {
130 ASSERT_WITH_SECURITY_IMPLICATION(!element.isFormControlElement()); 130 SECURITY_DCHECK(!element.isFormControlElement());
131 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement &>(element); 131 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement &>(element);
132 // We need to assert after the cast because FormAssociatedElement doesn't 132 // We need to assert after the cast because FormAssociatedElement doesn't
133 // have hasTagName. 133 // have hasTagName.
134 ASSERT_WITH_SECURITY_IMPLICATION(objectElement.hasTagName(HTMLNames::objectT ag)); 134 SECURITY_DCHECK(objectElement.hasTagName(HTMLNames::objectTag));
135 return objectElement; 135 return objectElement;
136 } 136 }
137 137
138 } // namespace blink 138 } // namespace blink
139 139
140 #endif // HTMLObjectElement_h 140 #endif // HTMLObjectElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLNameCollection.cpp ('k') | third_party/WebKit/Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698