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

Unified Diff: third_party/WebKit/Source/core/css/CSSSelector.h

Issue 2755493004: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ (Closed)
Patch Set: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSSelector.h
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.h b/third_party/WebKit/Source/core/css/CSSSelector.h
index fd527de16e1ad5f317c03e328d69aa1455c9c56b..030b3c952867aca19fe528d56d6d2e820e33e427 100644
--- a/third_party/WebKit/Source/core/css/CSSSelector.h
+++ b/third_party/WebKit/Source/core/css/CSSSelector.h
@@ -306,14 +306,14 @@ class CORE_EXPORT CSSSelector {
}
void setRelation(RelationType relation) {
m_relation = relation;
- ASSERT(static_cast<RelationType>(m_relation) ==
- relation); // using a bitfield.
+ DCHECK_EQ(static_cast<RelationType>(m_relation),
+ relation); // using a bitfield.
}
MatchType match() const { return static_cast<MatchType>(m_match); }
void setMatch(MatchType match) {
m_match = match;
- ASSERT(static_cast<MatchType>(m_match) == match); // using a bitfield.
+ DCHECK_EQ(static_cast<MatchType>(m_match), match); // using a bitfield.
}
bool isLastInSelectorList() const { return m_isLastInSelectorList; }
@@ -361,8 +361,8 @@ class CORE_EXPORT CSSSelector {
void setPseudoType(PseudoType pseudoType) {
m_pseudoType = pseudoType;
- ASSERT(static_cast<PseudoType>(m_pseudoType) ==
- pseudoType); // using a bitfield.
+ DCHECK_EQ(static_cast<PseudoType>(m_pseudoType),
+ pseudoType); // using a bitfield.
}
unsigned specificityForOneSelector() const;
@@ -410,14 +410,14 @@ class CORE_EXPORT CSSSelector {
};
inline const QualifiedName& CSSSelector::attribute() const {
- ASSERT(isAttributeSelector());
- ASSERT(m_hasRareData);
+ DCHECK(isAttributeSelector());
+ DCHECK(m_hasRareData);
return m_data.m_rareData->m_attribute;
}
inline CSSSelector::AttributeMatchType CSSSelector::attributeMatch() const {
- ASSERT(isAttributeSelector());
- ASSERT(m_hasRareData);
+ DCHECK(isAttributeSelector());
+ DCHECK(m_hasRareData);
return m_data.m_rareData->m_bits.m_attributeMatch;
}
@@ -431,7 +431,7 @@ inline bool CSSSelector::isASCIILower(const AtomicString& value) {
inline void CSSSelector::setValue(const AtomicString& value,
bool matchLowerCase = false) {
- ASSERT(m_match != Tag);
+ DCHECK_NE(m_match, Tag);
if (matchLowerCase && !m_hasRareData && !isASCIILower(value)) {
createRareData();
}
@@ -507,12 +507,12 @@ inline CSSSelector::~CSSSelector() {
}
inline const QualifiedName& CSSSelector::tagQName() const {
- ASSERT(m_match == Tag);
+ DCHECK_EQ(m_match, Tag);
return *reinterpret_cast<const QualifiedName*>(&m_data.m_tagQName);
}
inline const AtomicString& CSSSelector::value() const {
- ASSERT(m_match != Tag);
+ DCHECK_NE(m_match, Tag);
if (m_hasRareData)
return m_data.m_rareData->m_matchingValue;
// AtomicString is really just a StringImpl* so the cast below is safe.
@@ -521,7 +521,7 @@ inline const AtomicString& CSSSelector::value() const {
}
inline const AtomicString& CSSSelector::serializingValue() const {
- ASSERT(m_match != Tag);
+ DCHECK_NE(m_match, Tag);
if (m_hasRareData)
return m_data.m_rareData->m_serializingValue;
// AtomicString is really just a StringImpl* so the cast below is safe.

Powered by Google App Engine
This is Rietveld 408576698