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
reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 inline bool fastRejectSelector(const unsigned* identifierHashes) const; | 65 inline bool fastRejectSelector(const unsigned* identifierHashes) const; |
66 static void collectIdentifierHashes(const CSSSelector&, unsigned* identifier
Hashes, unsigned maximumIdentifierCount); | 66 static void collectIdentifierHashes(const CSSSelector&, unsigned* identifier
Hashes, unsigned maximumIdentifierCount); |
67 | 67 |
68 DECLARE_TRACE(); | 68 DECLARE_TRACE(); |
69 | 69 |
70 private: | 70 private: |
71 WillBeHeapVector<ParentStackFrame> m_parentStack; | 71 WillBeHeapVector<ParentStackFrame> m_parentStack; |
72 | 72 |
73 // With 100 unique strings in the filter, 2^12 slot table has false positive
rate of ~0.2%. | 73 // With 100 unique strings in the filter, 2^12 slot table has false positive
rate of ~0.2%. |
74 static const unsigned bloomFilterKeyBits = 12; | 74 static const unsigned bloomFilterKeyBits = 12; |
75 OwnPtr<BloomFilter<bloomFilterKeyBits> > m_ancestorIdentifierFilter; | 75 OwnPtr<BloomFilter<bloomFilterKeyBits>> m_ancestorIdentifierFilter; |
76 }; | 76 }; |
77 | 77 |
78 template <unsigned maximumIdentifierCount> | 78 template <unsigned maximumIdentifierCount> |
79 inline bool SelectorFilter::fastRejectSelector(const unsigned* identifierHashes)
const | 79 inline bool SelectorFilter::fastRejectSelector(const unsigned* identifierHashes)
const |
80 { | 80 { |
81 ASSERT(m_ancestorIdentifierFilter); | 81 ASSERT(m_ancestorIdentifierFilter); |
82 for (unsigned n = 0; n < maximumIdentifierCount && identifierHashes[n]; ++n)
{ | 82 for (unsigned n = 0; n < maximumIdentifierCount && identifierHashes[n]; ++n)
{ |
83 if (!m_ancestorIdentifierFilter->mayContain(identifierHashes[n])) | 83 if (!m_ancestorIdentifierFilter->mayContain(identifierHashes[n])) |
84 return true; | 84 return true; |
85 } | 85 } |
86 return false; | 86 return false; |
87 } | 87 } |
88 | 88 |
89 } | 89 } |
90 | 90 |
91 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::SelectorFilter::ParentStackFrame); | 91 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::SelectorFilter::ParentStackFrame); |
92 | 92 |
93 #endif | 93 #endif |
OLD | NEW |