OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 15 matching lines...) Expand all Loading... |
26 #ifndef HTMLEntityTable_h | 26 #ifndef HTMLEntityTable_h |
27 #define HTMLEntityTable_h | 27 #define HTMLEntityTable_h |
28 | 28 |
29 #include "wtf/Allocator.h" | 29 #include "wtf/Allocator.h" |
30 #include "wtf/text/WTFString.h" | 30 #include "wtf/text/WTFString.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 // Member order to optimize packing. There will be thousands of these objects. | 34 // Member order to optimize packing. There will be thousands of these objects. |
35 struct HTMLEntityTableEntry { | 35 struct HTMLEntityTableEntry { |
36 DISALLOW_ALLOCATION(); | 36 DISALLOW_NEW(); |
37 LChar lastCharacter() const; | 37 LChar lastCharacter() const; |
38 | 38 |
39 UChar32 firstValue; | 39 UChar32 firstValue; |
40 UChar secondValue; // UChar since double char sequences only use BMP chars. | 40 UChar secondValue; // UChar since double char sequences only use BMP chars. |
41 short entityOffset; | 41 short entityOffset; |
42 short length; | 42 short length; |
43 }; | 43 }; |
44 | 44 |
45 class HTMLEntityTable { | 45 class HTMLEntityTable { |
46 STATIC_ONLY(HTMLEntityTable); | 46 STATIC_ONLY(HTMLEntityTable); |
47 public: | 47 public: |
48 static const HTMLEntityTableEntry* firstEntry(); | 48 static const HTMLEntityTableEntry* firstEntry(); |
49 static const HTMLEntityTableEntry* lastEntry(); | 49 static const HTMLEntityTableEntry* lastEntry(); |
50 | 50 |
51 static const HTMLEntityTableEntry* firstEntryStartingWith(UChar); | 51 static const HTMLEntityTableEntry* firstEntryStartingWith(UChar); |
52 static const HTMLEntityTableEntry* lastEntryStartingWith(UChar); | 52 static const HTMLEntityTableEntry* lastEntryStartingWith(UChar); |
53 | 53 |
54 static const LChar* entityString(const HTMLEntityTableEntry&); | 54 static const LChar* entityString(const HTMLEntityTableEntry&); |
55 }; | 55 }; |
56 | 56 |
57 } | 57 } |
58 | 58 |
59 #endif | 59 #endif |
OLD | NEW |