OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
6 * reserved. | 6 * reserved. |
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 // With 100 unique strings in the filter, 2^12 slot table has false positive | 85 // With 100 unique strings in the filter, 2^12 slot table has false positive |
86 // rate of ~0.2%. | 86 // rate of ~0.2%. |
87 using IdentifierFilter = BloomFilter<12>; | 87 using IdentifierFilter = BloomFilter<12>; |
88 std::unique_ptr<IdentifierFilter> m_ancestorIdentifierFilter; | 88 std::unique_ptr<IdentifierFilter> m_ancestorIdentifierFilter; |
89 }; | 89 }; |
90 | 90 |
91 template <unsigned maximumIdentifierCount> | 91 template <unsigned maximumIdentifierCount> |
92 inline bool SelectorFilter::fastRejectSelector( | 92 inline bool SelectorFilter::fastRejectSelector( |
93 const unsigned* identifierHashes) const { | 93 const unsigned* identifierHashes) const { |
94 ASSERT(m_ancestorIdentifierFilter); | 94 DCHECK(m_ancestorIdentifierFilter); |
95 for (unsigned n = 0; n < maximumIdentifierCount && identifierHashes[n]; ++n) { | 95 for (unsigned n = 0; n < maximumIdentifierCount && identifierHashes[n]; ++n) { |
96 if (!m_ancestorIdentifierFilter->mayContain(identifierHashes[n])) | 96 if (!m_ancestorIdentifierFilter->mayContain(identifierHashes[n])) |
97 return true; | 97 return true; |
98 } | 98 } |
99 return false; | 99 return false; |
100 } | 100 } |
101 | 101 |
102 } // namespace blink | 102 } // namespace blink |
103 | 103 |
104 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::SelectorFilter::ParentStackFrame); | 104 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::SelectorFilter::ParentStackFrame); |
105 | 105 |
106 #endif | 106 #endif |
OLD | NEW |