summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/wtf/BitArray.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/wtf/BitArray.h')
-rw-r--r--chromium/third_party/WebKit/Source/wtf/BitArray.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/chromium/third_party/WebKit/Source/wtf/BitArray.h b/chromium/third_party/WebKit/Source/wtf/BitArray.h
index f1095150619..54b84b46d37 100644
--- a/chromium/third_party/WebKit/Source/wtf/BitArray.h
+++ b/chromium/third_party/WebKit/Source/wtf/BitArray.h
@@ -34,9 +34,9 @@ namespace WTF {
template<unsigned arraySize>
class BitArray {
public:
- BitArray()
+ BitArray(bool value = false)
{
- memset(m_data, 0, sizeof(m_data));
+ memset(m_data, value ? 0xFF : 0, sizeof(m_data));
}
void set(unsigned index)
@@ -45,6 +45,12 @@ public:
m_data[index / 8] |= 1 << (index & 7);
}
+ void clear(unsigned index)
+ {
+ ASSERT_WITH_SECURITY_IMPLICATION(index < arraySize);
+ m_data[index / 8] &= ~(1 << (index & 7));
+ }
+
bool get(unsigned index) const
{
ASSERT_WITH_SECURITY_IMPLICATION(index < arraySize);