Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 {% from 'macros.tmpl' import trie_length_switch %} | |
| 2 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 3 // Use of this source code is governed by a BSD-style license that can be | |
| 4 // found in the LICENSE file. | |
| 5 | |
| 6 #include "core/css/CSSPrimitiveValueUnitTrie.h" | |
| 7 #include "core/css/CSSPrimitiveValue.h" | |
| 8 | |
| 9 namespace blink { | |
| 10 | |
| 11 namespace { | |
| 12 | |
| 13 template<typename CharacterType> | |
| 14 CSSPrimitiveValue::UnitType cssPrimitiveValueUnitFromTrie(const CharacterType* d ata, unsigned length) | |
| 15 { | |
| 16 DCHECK(data); | |
| 17 DCHECK(length); | |
| 18 {% macro trie_return_statement(unit_name) %}CSSPrimitiveValue::UnitType::{{u nit_name}}{% endmacro %} | |
| 19 {{ trie_length_switch(length_tries, trie_return_statement, trie_return_state ment(default_value), True) | indent(4) }} | |
| 20 return {{ trie_return_statement(default_value) }}; | |
|
Timothy Loh
2016/05/13 06:54:48
I think it's clearer to just return CSSPrimitiveVa
| |
| 21 } | |
| 22 | |
| 23 } // namespace | |
| 24 | |
| 25 CSSPrimitiveValue::UnitType lookupCSSPrimitiveValueUnit(const LChar* characters8 , unsigned length) | |
| 26 { | |
| 27 return cssPrimitiveValueUnitFromTrie(characters8, length); | |
| 28 } | |
| 29 | |
| 30 CSSPrimitiveValue::UnitType lookupCSSPrimitiveValueUnit(const UChar* characters1 6, unsigned length) | |
| 31 { | |
| 32 return cssPrimitiveValueUnitFromTrie(characters16, length); | |
| 33 } | |
| 34 | |
| 35 } // namespace blink | |
| 36 | |
| OLD | NEW |