OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 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 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/html/parser/CompactHTMLToken.h" | 27 #include "core/html/parser/CompactHTMLToken.h" |
28 | 28 |
29 #include "core/dom/QualifiedName.h" | 29 #include "core/dom/QualifiedName.h" |
30 #include "core/html/parser/HTMLParserIdioms.h" | 30 #include "core/html/parser/HTMLParserIdioms.h" |
| 31 #include "wtf/SizeAssertions.h" |
31 | 32 |
32 namespace blink { | 33 namespace blink { |
33 | 34 |
34 struct SameSizeAsCompactHTMLToken { | 35 ASSERT_SIZE(CompactHTMLToken, 28, 40); |
35 unsigned bitfields; | |
36 String data; | |
37 Vector<Attribute> vector; | |
38 TextPosition textPosition; | |
39 }; | |
40 | |
41 static_assert(sizeof(CompactHTMLToken) == sizeof(SameSizeAsCompactHTMLToken), "C
ompactHTMLToken should stay small"); | |
42 | 36 |
43 CompactHTMLToken::CompactHTMLToken(const HTMLToken* token, const TextPosition& t
extPosition) | 37 CompactHTMLToken::CompactHTMLToken(const HTMLToken* token, const TextPosition& t
extPosition) |
44 : m_type(token->type()) | 38 : m_type(token->type()) |
45 , m_isAll8BitData(false) | 39 , m_isAll8BitData(false) |
46 , m_doctypeForcesQuirks(false) | 40 , m_doctypeForcesQuirks(false) |
47 , m_textPosition(textPosition) | 41 , m_textPosition(textPosition) |
48 { | 42 { |
49 switch (m_type) { | 43 switch (m_type) { |
50 case HTMLToken::Uninitialized: | 44 case HTMLToken::Uninitialized: |
51 ASSERT_NOT_REACHED(); | 45 ASSERT_NOT_REACHED(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 for (const Attribute& attribute : m_attributes) { | 89 for (const Attribute& attribute : m_attributes) { |
96 if (!attribute.name.isSafeToSendToAnotherThread()) | 90 if (!attribute.name.isSafeToSendToAnotherThread()) |
97 return false; | 91 return false; |
98 if (!attribute.value.isSafeToSendToAnotherThread()) | 92 if (!attribute.value.isSafeToSendToAnotherThread()) |
99 return false; | 93 return false; |
100 } | 94 } |
101 return m_data.isSafeToSendToAnotherThread(); | 95 return m_data.isSafeToSendToAnotherThread(); |
102 } | 96 } |
103 | 97 |
104 } | 98 } |
OLD | NEW |