| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 108 } |
| 109 | 109 |
| 110 DECLARE_TRACE(); | 110 DECLARE_TRACE(); |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 Member<StyleRule> m_rule; | 113 Member<StyleRule> m_rule; |
| 114 // This number is picked fairly arbitrary. If lowered, be aware that there | 114 // This number is picked fairly arbitrary. If lowered, be aware that there |
| 115 // might be sites and extensions using style rules with selector lists | 115 // might be sites and extensions using style rules with selector lists |
| 116 // exceeding the number of simple selectors to fit in this bitfield. | 116 // exceeding the number of simple selectors to fit in this bitfield. |
| 117 // See https://crbug.com/312913 and https://crbug.com/704562 | 117 // See https://crbug.com/312913 and https://crbug.com/704562 |
| 118 unsigned m_selectorIndex : 14; | 118 unsigned m_selectorIndex : 13; |
| 119 // We store an array of RuleData objects in a primitive array. |
| 120 unsigned m_isLastInArray : 1; |
| 119 // This number was picked fairly arbitrarily. We can probably lower it if we | 121 // This number was picked fairly arbitrarily. We can probably lower it if we |
| 120 // need to. Some simple testing showed <100,000 RuleData's on large sites. | 122 // need to. Some simple testing showed <100,000 RuleData's on large sites. |
| 121 unsigned m_position : 18; | 123 unsigned m_position : 18; |
| 122 // 32 bits above | 124 // 32 bits above |
| 123 unsigned m_specificity : 24; | 125 unsigned m_specificity : 24; |
| 124 unsigned m_containsUncommonAttributeSelector : 1; | 126 unsigned m_containsUncommonAttributeSelector : 1; |
| 125 unsigned m_linkMatchType : 2; // CSSSelector::LinkMatchMask | 127 unsigned m_linkMatchType : 2; // CSSSelector::LinkMatchMask |
| 126 unsigned m_hasDocumentSecurityOrigin : 1; | 128 unsigned m_hasDocumentSecurityOrigin : 1; |
| 127 unsigned m_propertyWhitelist : 2; | 129 unsigned m_propertyWhitelist : 2; |
| 128 // We store an array of RuleData objects in a primitive array. | 130 // 30 bits above |
| 129 unsigned m_isLastInArray : 1; | |
| 130 // 31 bits above | |
| 131 // Use plain array instead of a Vector to minimize memory overhead. | 131 // Use plain array instead of a Vector to minimize memory overhead. |
| 132 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount]; | 132 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount]; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } // namespace blink | 135 } // namespace blink |
| 136 | 136 |
| 137 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); | 137 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); |
| 138 | 138 |
| 139 namespace blink { | 139 namespace blink { |
| 140 | 140 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 Member<PendingRuleMaps> m_pendingRules; | 318 Member<PendingRuleMaps> m_pendingRules; |
| 319 | 319 |
| 320 #ifndef NDEBUG | 320 #ifndef NDEBUG |
| 321 HeapVector<RuleData> m_allRules; | 321 HeapVector<RuleData> m_allRules; |
| 322 #endif | 322 #endif |
| 323 }; | 323 }; |
| 324 | 324 |
| 325 } // namespace blink | 325 } // namespace blink |
| 326 | 326 |
| 327 #endif // RuleSet_h | 327 #endif // RuleSet_h |
| OLD | NEW |