OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
35 #include "wtf/Allocator.h" | 35 #include "wtf/Allocator.h" |
36 #include "wtf/Assertions.h" | 36 #include "wtf/Assertions.h" |
37 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
38 #include "wtf/HashSet.h" | 38 #include "wtf/HashSet.h" |
39 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
40 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
41 #include "wtf/text/AtomicStringHash.h" | 41 #include "wtf/text/AtomicStringHash.h" |
42 #include "wtf/text/StringHash.h" | 42 #include "wtf/text/StringHash.h" |
| 43 #include <memory> |
43 | 44 |
44 namespace blink { | 45 namespace blink { |
45 | 46 |
46 class Element; | 47 class Element; |
47 class TracedValue; | 48 class TracedValue; |
48 | 49 |
49 enum InvalidationType { | 50 enum InvalidationType { |
50 InvalidateDescendants, | 51 InvalidateDescendants, |
51 InvalidateSiblings | 52 InvalidateSiblings |
52 }; | 53 }; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 140 |
140 private: | 141 private: |
141 void destroy(); | 142 void destroy(); |
142 | 143 |
143 HashSet<AtomicString>& ensureClassSet(); | 144 HashSet<AtomicString>& ensureClassSet(); |
144 HashSet<AtomicString>& ensureIdSet(); | 145 HashSet<AtomicString>& ensureIdSet(); |
145 HashSet<AtomicString>& ensureTagNameSet(); | 146 HashSet<AtomicString>& ensureTagNameSet(); |
146 HashSet<AtomicString>& ensureAttributeSet(); | 147 HashSet<AtomicString>& ensureAttributeSet(); |
147 | 148 |
148 // FIXME: optimize this if it becomes a memory issue. | 149 // FIXME: optimize this if it becomes a memory issue. |
149 OwnPtr<HashSet<AtomicString>> m_classes; | 150 std::unique_ptr<HashSet<AtomicString>> m_classes; |
150 OwnPtr<HashSet<AtomicString>> m_ids; | 151 std::unique_ptr<HashSet<AtomicString>> m_ids; |
151 OwnPtr<HashSet<AtomicString>> m_tagNames; | 152 std::unique_ptr<HashSet<AtomicString>> m_tagNames; |
152 OwnPtr<HashSet<AtomicString>> m_attributes; | 153 std::unique_ptr<HashSet<AtomicString>> m_attributes; |
153 | 154 |
154 unsigned m_type : 1; | 155 unsigned m_type : 1; |
155 | 156 |
156 // If true, all descendants might be invalidated, so a full subtree recalc i
s required. | 157 // If true, all descendants might be invalidated, so a full subtree recalc i
s required. |
157 unsigned m_allDescendantsMightBeInvalid : 1; | 158 unsigned m_allDescendantsMightBeInvalid : 1; |
158 | 159 |
159 // If true, the element or sibling itself is invalid. | 160 // If true, the element or sibling itself is invalid. |
160 unsigned m_invalidatesSelf : 1; | 161 unsigned m_invalidatesSelf : 1; |
161 | 162 |
162 // If true, all descendants which are custom pseudo elements must be invalid
ated. | 163 // If true, all descendants which are custom pseudo elements must be invalid
ated. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 InvalidationSetVector descendants; | 221 InvalidationSetVector descendants; |
221 InvalidationSetVector siblings; | 222 InvalidationSetVector siblings; |
222 }; | 223 }; |
223 | 224 |
224 DEFINE_TYPE_CASTS(DescendantInvalidationSet, InvalidationSet, value, value->isDe
scendantInvalidationSet(), value.isDescendantInvalidationSet()); | 225 DEFINE_TYPE_CASTS(DescendantInvalidationSet, InvalidationSet, value, value->isDe
scendantInvalidationSet(), value.isDescendantInvalidationSet()); |
225 DEFINE_TYPE_CASTS(SiblingInvalidationSet, InvalidationSet, value, value->isSibli
ngInvalidationSet(), value.isSiblingInvalidationSet()); | 226 DEFINE_TYPE_CASTS(SiblingInvalidationSet, InvalidationSet, value, value->isSibli
ngInvalidationSet(), value.isSiblingInvalidationSet()); |
226 | 227 |
227 } // namespace blink | 228 } // namespace blink |
228 | 229 |
229 #endif // InvalidationSet_h | 230 #endif // InvalidationSet_h |
OLD | NEW |