OLD | NEW |
---|---|
(Empty) | |
1 {% from 'macros.tmpl' import trie_length_switch %} | |
2 {% macro trie_return_statement(unit_name) %}CSSPrimitiveValue::UnitType::{{unit_ name}}{% endmacro %} | |
Timothy Loh
2016/05/12 07:03:14
can this line be right before calling trie_length_
meade_UTC10
2016/05/13 04:32:05
Done.
| |
3 // Copyright 2016 The Chromium Authors. All rights reserved. | |
4 // Use of this source code is governed by a BSD-style license that can be | |
5 // found in the LICENSE file. | |
6 | |
7 #include "core/css/CSSPrimitiveValueUnitTrie.h" | |
8 #include "core/css/CSSPrimitiveValue.h" | |
9 | |
10 namespace blink { | |
11 | |
12 namespace { | |
13 | |
14 template<typename CharacterType> | |
15 CSSPrimitiveValue::UnitType cssPrimitiveValueUnitFromTrie(const CharacterType* d ata, unsigned length) | |
16 { | |
17 DCHECK(data); | |
18 DCHECK(length); | |
19 {{ trie_length_switch(trie_return_statement(empty_case), length_tries, trie_ return_statement, trie_return_statement(default_value), True) | indent(4) }} | |
20 } | |
21 | |
22 } // namespace | |
23 | |
24 CSSPrimitiveValue::UnitType lookupCSSPrimitiveValueUnit(const LChar* characters8 , unsigned length) | |
25 { | |
26 return cssPrimitiveValueUnitFromTrie(characters8, length); | |
27 } | |
28 | |
29 CSSPrimitiveValue::UnitType lookupCSSPrimitiveValueUnit(const UChar* characters1 6, unsigned length) | |
30 { | |
31 return cssPrimitiveValueUnitFromTrie(characters16, length); | |
32 } | |
33 | |
34 } // namespace blink | |
35 | |
OLD | NEW |