ShareableElementData should use zero-length array for storage.
[WebKit-https.git] / Source / WebCore / dom / DocumentSharedObjectPool.cpp
index 0af630c2c142414a4dbf999a15f2ae7f28074cb1..997e8668d15b505c51386d41ad2bc230d7bd2b07 100644 (file)
@@ -57,16 +57,16 @@ private:
 
 class ShareableElementDataCacheEntry {
 public:
 
 class ShareableElementDataCacheEntry {
 public:
-    ShareableElementDataCacheEntry(const ShareableElementDataCacheKey& k, PassRefPtr<ElementData> v)
+    ShareableElementDataCacheEntry(const ShareableElementDataCacheKey& k, PassRefPtr<ShareableElementData> v)
         : key(k)
         , value(v)
     { }
 
     ShareableElementDataCacheKey key;
         : key(k)
         , value(v)
     { }
 
     ShareableElementDataCacheKey key;
-    RefPtr<ElementData> value;
+    RefPtr<ShareableElementData> value;
 };
 
 };
 
-PassRefPtr<ElementData> DocumentSharedObjectPool::cachedShareableElementDataWithAttributes(const Vector<Attribute>& attributes)
+PassRefPtr<ShareableElementData> DocumentSharedObjectPool::cachedShareableElementDataWithAttributes(const Vector<Attribute>& attributes)
 {
     ASSERT(!attributes.isEmpty());
 
 {
     ASSERT(!attributes.isEmpty());
 
@@ -77,16 +77,16 @@ PassRefPtr<ElementData> DocumentSharedObjectPool::cachedShareableElementDataWith
     if (cacheIterator->value && cacheIterator->value->key != cacheKey)
         cacheHash = 0;
 
     if (cacheIterator->value && cacheIterator->value->key != cacheKey)
         cacheHash = 0;
 
-    RefPtr<ElementData> elementData;
+    RefPtr<ShareableElementData> elementData;
     if (cacheHash && cacheIterator->value)
         elementData = cacheIterator->value->value;
     else
     if (cacheHash && cacheIterator->value)
         elementData = cacheIterator->value->value;
     else
-        elementData = ElementData::createShareableWithAttributes(attributes);
+        elementData = ShareableElementData::createWithAttributes(attributes);
 
     if (!cacheHash || cacheIterator->value)
         return elementData.release();
 
 
     if (!cacheHash || cacheIterator->value)
         return elementData.release();
 
-    cacheIterator->value = adoptPtr(new ShareableElementDataCacheEntry(ShareableElementDataCacheKey(elementData->immutableAttributeArray(), elementData->length()), elementData));
+    cacheIterator->value = adoptPtr(new ShareableElementDataCacheEntry(ShareableElementDataCacheKey(elementData->m_attributeArray, elementData->length()), elementData));
 
     return elementData.release();
 }
 
     return elementData.release();
 }