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

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

Issue 2458003002: Remove ASSERT_WITH_SECURITY_IMPLICATION. (Closed)
Patch Set: Minor formatting fix Created 4 years, 1 month 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 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 m_childRules.append(rule); 175 m_childRules.append(rule);
176 } 176 }
177 177
178 void StyleSheetContents::setHasMediaQueries() { 178 void StyleSheetContents::setHasMediaQueries() {
179 m_hasMediaQueries = true; 179 m_hasMediaQueries = true;
180 if (parentStyleSheet()) 180 if (parentStyleSheet())
181 parentStyleSheet()->setHasMediaQueries(); 181 parentStyleSheet()->setHasMediaQueries();
182 } 182 }
183 183
184 StyleRuleBase* StyleSheetContents::ruleAt(unsigned index) const { 184 StyleRuleBase* StyleSheetContents::ruleAt(unsigned index) const {
185 ASSERT_WITH_SECURITY_IMPLICATION(index < ruleCount()); 185 SECURITY_DCHECK(index < ruleCount());
186 186
187 if (index < m_importRules.size()) 187 if (index < m_importRules.size())
188 return m_importRules[index].get(); 188 return m_importRules[index].get();
189 189
190 index -= m_importRules.size(); 190 index -= m_importRules.size();
191 191
192 if (index < m_namespaceRules.size()) 192 if (index < m_namespaceRules.size())
193 return m_namespaceRules[index].get(); 193 return m_namespaceRules[index].get();
194 194
195 index -= m_namespaceRules.size(); 195 index -= m_namespaceRules.size();
(...skipping 11 matching lines...) Expand all
207 m_importRules[i]->clearParentStyleSheet(); 207 m_importRules[i]->clearParentStyleSheet();
208 } 208 }
209 m_importRules.clear(); 209 m_importRules.clear();
210 m_namespaceRules.clear(); 210 m_namespaceRules.clear();
211 m_childRules.clear(); 211 m_childRules.clear();
212 } 212 }
213 213
214 bool StyleSheetContents::wrapperInsertRule(StyleRuleBase* rule, 214 bool StyleSheetContents::wrapperInsertRule(StyleRuleBase* rule,
215 unsigned index) { 215 unsigned index) {
216 ASSERT(m_isMutable); 216 ASSERT(m_isMutable);
217 ASSERT_WITH_SECURITY_IMPLICATION(index <= ruleCount()); 217 SECURITY_DCHECK(index <= ruleCount());
218 218
219 if (index < m_importRules.size() || 219 if (index < m_importRules.size() ||
220 (index == m_importRules.size() && rule->isImportRule())) { 220 (index == m_importRules.size() && rule->isImportRule())) {
221 // Inserting non-import rule before @import is not allowed. 221 // Inserting non-import rule before @import is not allowed.
222 if (!rule->isImportRule()) 222 if (!rule->isImportRule())
223 return false; 223 return false;
224 224
225 StyleRuleImport* importRule = toStyleRuleImport(rule); 225 StyleRuleImport* importRule = toStyleRuleImport(rule);
226 if (importRule->mediaQueries()) 226 if (importRule->mediaQueries())
227 setHasMediaQueries(); 227 setHasMediaQueries();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 return false; 267 return false;
268 268
269 index -= m_namespaceRules.size(); 269 index -= m_namespaceRules.size();
270 270
271 m_childRules.insert(index, rule); 271 m_childRules.insert(index, rule);
272 return true; 272 return true;
273 } 273 }
274 274
275 bool StyleSheetContents::wrapperDeleteRule(unsigned index) { 275 bool StyleSheetContents::wrapperDeleteRule(unsigned index) {
276 ASSERT(m_isMutable); 276 ASSERT(m_isMutable);
277 ASSERT_WITH_SECURITY_IMPLICATION(index < ruleCount()); 277 SECURITY_DCHECK(index < ruleCount());
278 278
279 if (index < m_importRules.size()) { 279 if (index < m_importRules.size()) {
280 m_importRules[index]->clearParentStyleSheet(); 280 m_importRules[index]->clearParentStyleSheet();
281 if (m_importRules[index]->isFontFaceRule()) 281 if (m_importRules[index]->isFontFaceRule())
282 notifyRemoveFontFaceRule(toStyleRuleFontFace(m_importRules[index].get())); 282 notifyRemoveFontFaceRule(toStyleRuleFontFace(m_importRules[index].get()));
283 m_importRules.remove(index); 283 m_importRules.remove(index);
284 return true; 284 return true;
285 } 285 }
286 index -= m_importRules.size(); 286 index -= m_importRules.size();
287 287
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 visitor->trace(m_importRules); 669 visitor->trace(m_importRules);
670 visitor->trace(m_namespaceRules); 670 visitor->trace(m_namespaceRules);
671 visitor->trace(m_childRules); 671 visitor->trace(m_childRules);
672 visitor->trace(m_loadingClients); 672 visitor->trace(m_loadingClients);
673 visitor->trace(m_completedClients); 673 visitor->trace(m_completedClients);
674 visitor->trace(m_ruleSet); 674 visitor->trace(m_ruleSet);
675 visitor->trace(m_referencedFromResource); 675 visitor->trace(m_referencedFromResource);
676 } 676 }
677 677
678 } // namespace blink 678 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontStyleMatcher.cpp ('k') | third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698