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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSTokenizer.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/parser/CSSTokenizer.h" 5 #include "core/css/parser/CSSTokenizer.h"
6 6
7 namespace blink { 7 namespace blink {
8 #include "core/CSSTokenizerCodepoints.cpp" 8 #include "core/CSSTokenizerCodepoints.cpp"
9 } 9 }
10 10
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // as a stateless, (fixed-size) look-ahead tokenizer. 310 // as a stateless, (fixed-size) look-ahead tokenizer.
311 // We could move to the stateful model and instead create 311 // We could move to the stateful model and instead create
312 // states for all the "next 3 codepoints are X" cases. 312 // states for all the "next 3 codepoints are X" cases.
313 // State-machine tokenizers are easier to write to handle 313 // State-machine tokenizers are easier to write to handle
314 // incremental tokenization of partial sources. 314 // incremental tokenization of partial sources.
315 // However, for now we follow the spec exactly. 315 // However, for now we follow the spec exactly.
316 UChar cc = consume(); 316 UChar cc = consume();
317 CodePoint codePointFunc = 0; 317 CodePoint codePointFunc = 0;
318 318
319 if (isASCII(cc)) { 319 if (isASCII(cc)) {
320 ASSERT_WITH_SECURITY_IMPLICATION(cc < codePointsNumber); 320 SECURITY_DCHECK(cc < codePointsNumber);
321 codePointFunc = codePoints[cc]; 321 codePointFunc = codePoints[cc];
322 } else { 322 } else {
323 codePointFunc = &CSSTokenizer::nameStart; 323 codePointFunc = &CSSTokenizer::nameStart;
324 } 324 }
325 325
326 if (codePointFunc) 326 if (codePointFunc)
327 return ((this)->*(codePointFunc))(cc); 327 return ((this)->*(codePointFunc))(cc);
328 return CSSParserToken(DelimiterToken, cc); 328 return CSSParserToken(DelimiterToken, cc);
329 } 329 }
330 330
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 reconsume(first); 684 reconsume(first);
685 return areIdentifier; 685 return areIdentifier;
686 } 686 }
687 687
688 StringView CSSTokenizer::registerString(const String& string) { 688 StringView CSSTokenizer::registerString(const String& string) {
689 m_scope.storeString(string); 689 m_scope.storeString(string);
690 return string; 690 return string;
691 } 691 }
692 692
693 } // namespace blink 693 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698