Index: Source/core/css/RuntimeCSSEnabled.cpp |
diff --git a/Source/core/css/RuntimeCSSEnabled.cpp b/Source/core/css/RuntimeCSSEnabled.cpp |
index 4fc13b0f4b207a90177a6ee6771fdb4c31f8f832..2daccd217aeaedcd3753e514897da62a819d8e20 100644 |
--- a/Source/core/css/RuntimeCSSEnabled.cpp |
+++ b/Source/core/css/RuntimeCSSEnabled.cpp |
@@ -31,12 +31,10 @@ |
#include "core/css/RuntimeCSSEnabled.h" |
#include "RuntimeEnabledFeatures.h" |
+#include "wtf/BitVector.h" |
namespace WebCore { |
-// FIXME: We should use a real BitVector class instead! |
-typedef Vector<bool> BoolVector; |
- |
static void setCSSPropertiesEnabled(CSSPropertyID* properties, size_t length, bool featureFlag) |
{ |
for (size_t i = 0; i < length; i++) |
@@ -130,12 +128,12 @@ static void setPropertySwitchesFromRuntimeFeatures() |
RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyInternalCallback, false); |
} |
-static BoolVector& propertySwitches() |
+static BitVector& propertySwitches() |
{ |
- static BoolVector* switches = 0; |
+ static BitVector* switches = 0; |
dstockwell
2014/05/21 00:45:41
A BitArray might be more appropriate.
Inactive
2014/05/21 01:04:49
Ah, I didn't know we had one. This is more suitabl
|
if (!switches) { |
- switches = new BoolVector; |
- switches->fill(true, numCSSProperties); |
+ switches = new BitVector(numCSSProperties); |
+ switches->setAll(); |
setPropertySwitchesFromRuntimeFeatures(); |
} |
return *switches; |
@@ -155,12 +153,12 @@ bool RuntimeCSSEnabled::isCSSPropertyEnabled(CSSPropertyID propertyId) |
if (isInternalProperty(propertyId)) |
return false; |
- return propertySwitches()[indexForProperty(propertyId)]; |
+ return propertySwitches().quickGet(indexForProperty(propertyId)); |
} |
void RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyID propertyId, bool enable) |
{ |
- propertySwitches()[indexForProperty(propertyId)] = enable; |
+ propertySwitches().quickSet(indexForProperty(propertyId), enable); |
} |
void RuntimeCSSEnabled::filterEnabledCSSPropertiesIntoVector(const CSSPropertyID* properties, size_t propertyCount, Vector<CSSPropertyID>& outVector) |