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

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

Issue 2755493004: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ (Closed)
Patch Set: All windows error are Resolved now. Created 3 years, 8 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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 NOTREACHED(); 147 NOTREACHED();
148 return nullptr; 148 return nullptr;
149 case Keyframes: 149 case Keyframes:
150 return toStyleRuleKeyframes(this)->copy(); 150 return toStyleRuleKeyframes(this)->copy();
151 case Viewport: 151 case Viewport:
152 return toStyleRuleViewport(this)->copy(); 152 return toStyleRuleViewport(this)->copy();
153 case Namespace: 153 case Namespace:
154 return toStyleRuleNamespace(this)->copy(); 154 return toStyleRuleNamespace(this)->copy();
155 case Charset: 155 case Charset:
156 case Keyframe: 156 case Keyframe:
157 ASSERT_NOT_REACHED(); 157 NOTREACHED();
158 return nullptr; 158 return nullptr;
159 } 159 }
160 ASSERT_NOT_REACHED(); 160 NOTREACHED();
161 return nullptr; 161 return nullptr;
162 } 162 }
163 163
164 CSSRule* StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet, 164 CSSRule* StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet,
165 CSSRule* parentRule) const { 165 CSSRule* parentRule) const {
166 CSSRule* rule = nullptr; 166 CSSRule* rule = nullptr;
167 StyleRuleBase* self = const_cast<StyleRuleBase*>(this); 167 StyleRuleBase* self = const_cast<StyleRuleBase*>(this);
168 switch (type()) { 168 switch (type()) {
169 case Style: 169 case Style:
170 rule = CSSStyleRule::create(toStyleRule(self), parentSheet); 170 rule = CSSStyleRule::create(toStyleRule(self), parentSheet);
(...skipping 17 matching lines...) Expand all
188 rule = CSSKeyframesRule::create(toStyleRuleKeyframes(self), parentSheet); 188 rule = CSSKeyframesRule::create(toStyleRuleKeyframes(self), parentSheet);
189 break; 189 break;
190 case Namespace: 190 case Namespace:
191 rule = CSSNamespaceRule::create(toStyleRuleNamespace(self), parentSheet); 191 rule = CSSNamespaceRule::create(toStyleRuleNamespace(self), parentSheet);
192 break; 192 break;
193 case Viewport: 193 case Viewport:
194 rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet); 194 rule = CSSViewportRule::create(toStyleRuleViewport(self), parentSheet);
195 break; 195 break;
196 case Keyframe: 196 case Keyframe:
197 case Charset: 197 case Charset:
198 ASSERT_NOT_REACHED(); 198 NOTREACHED();
199 return nullptr; 199 return nullptr;
200 } 200 }
201 if (parentRule) 201 if (parentRule)
202 rule->setParentRule(parentRule); 202 rule->setParentRule(parentRule);
203 return rule; 203 return rule;
204 } 204 }
205 205
206 unsigned StyleRule::averageSizeInBytes() { 206 unsigned StyleRule::averageSizeInBytes() {
207 return sizeof(StyleRule) + sizeof(CSSSelector) + 207 return sizeof(StyleRule) + sizeof(CSSSelector) +
208 StylePropertySet::averageSizeInBytes(); 208 StylePropertySet::averageSizeInBytes();
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 m_properties = m_properties->mutableCopy(); 392 m_properties = m_properties->mutableCopy();
393 return *toMutableStylePropertySet(m_properties); 393 return *toMutableStylePropertySet(m_properties);
394 } 394 }
395 395
396 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) { 396 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) {
397 visitor->trace(m_properties); 397 visitor->trace(m_properties);
398 StyleRuleBase::traceAfterDispatch(visitor); 398 StyleRuleBase::traceAfterDispatch(visitor);
399 } 399 }
400 400
401 } // namespace blink 401 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698