Title: [103864] trunk/Source/WebCore
Revision
103864
Author
[email protected]
Date
2011-12-31 16:50:00 -0800 (Sat, 31 Dec 2011)

Log Message

Remove Document::collectionInfo() and let collections manage their caches.
<http://webkit.org/b/75401>

Reviewed by Anders Carlsson.

Remove the CollectionCaches from Document and have the document's collections
create and manage the caches on-demand instead. This is a step towards merging
CollectionCache into HTMLCollection.

* dom/Document.h:
* dom/Document.cpp:
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
* html/HTMLOptionsCollection.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (103863 => 103864)


--- trunk/Source/WebCore/ChangeLog	2011-12-31 23:41:55 UTC (rev 103863)
+++ trunk/Source/WebCore/ChangeLog	2012-01-01 00:50:00 UTC (rev 103864)
@@ -1,5 +1,22 @@
 2012-01-01  Andreas Kling  <[email protected]>
 
+        Remove Document::collectionInfo() and let collections manage their caches.
+        <http://webkit.org/b/75401>
+
+        Reviewed by Anders Carlsson.
+
+        Remove the CollectionCaches from Document and have the document's collections
+        create and manage the caches on-demand instead. This is a step towards merging
+        CollectionCache into HTMLCollection.
+
+        * dom/Document.h:
+        * dom/Document.cpp:
+        * html/HTMLCollection.cpp:
+        (WebCore::HTMLCollection::HTMLCollection):
+        * html/HTMLOptionsCollection.cpp:
+
+2012-01-01  Andreas Kling  <[email protected]>
+
         RenderThemeMac: Avoid double hash lookup in systemColor().
         <http://webkit.org/b/75409>
 

Modified: trunk/Source/WebCore/dom/Document.cpp (103863 => 103864)


--- trunk/Source/WebCore/dom/Document.cpp	2011-12-31 23:41:55 UTC (rev 103863)
+++ trunk/Source/WebCore/dom/Document.cpp	2012-01-01 00:50:00 UTC (rev 103864)
@@ -41,6 +41,7 @@
 #include "CachedResourceLoader.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
+#include "CollectionCache.h"
 #include "Comment.h"
 #include "Console.h"
 #include "ContentSecurityPolicy.h"

Modified: trunk/Source/WebCore/dom/Document.h (103863 => 103864)


--- trunk/Source/WebCore/dom/Document.h	2011-12-31 23:41:55 UTC (rev 103863)
+++ trunk/Source/WebCore/dom/Document.h	2012-01-01 00:50:00 UTC (rev 103864)
@@ -29,7 +29,6 @@
 #define Document_h
 
 #include "CheckedRadioButtons.h"
-#include "CollectionCache.h"
 #include "CollectionType.h"
 #include "Color.h"
 #include "DOMTimeStamp.h"
@@ -138,6 +137,8 @@
 class XPathNSResolver;
 class XPathResult;
 
+struct CollectionCache;
+
 #if ENABLE(SVG)
 class SVGDocumentExtensions;
 #endif
@@ -424,15 +425,6 @@
 
     PassRefPtr<HTMLAllCollection> all();
 
-    CollectionCache* collectionInfo(CollectionType type)
-    {
-        ASSERT(type >= FirstUnnamedDocumentCachedType);
-        unsigned index = type - FirstUnnamedDocumentCachedType;
-        ASSERT(index < NumUnnamedDocumentCachedTypes);
-        m_collectionInfo[index].checkConsistency();
-        return &m_collectionInfo[index]; 
-    }
-
     CollectionCache* nameCollectionInfo(CollectionType, const AtomicString& name);
 
     // Other methods (not part of DOM)
@@ -1373,7 +1365,6 @@
     RefPtr<HTMLAllCollection> m_allCollection;
 
     typedef HashMap<AtomicStringImpl*, OwnPtr<CollectionCache> > NamedCollectionMap;
-    FixedArray<CollectionCache, NumUnnamedDocumentCachedTypes> m_collectionInfo;
     FixedArray<NamedCollectionMap, NumNamedDocumentCachedTypes> m_nameCollectionInfo;
 
     RefPtr<XPathEvaluator> m_xpathEvaluator;

Modified: trunk/Source/WebCore/html/HTMLCollection.cpp (103863 => 103864)


--- trunk/Source/WebCore/html/HTMLCollection.cpp	2011-12-31 23:41:55 UTC (rev 103863)
+++ trunk/Source/WebCore/html/HTMLCollection.cpp	2012-01-01 00:50:00 UTC (rev 103864)
@@ -23,6 +23,7 @@
 #include "config.h"
 #include "HTMLCollection.h"
 
+#include "CollectionCache.h"
 #include "HTMLDocument.h"
 #include "HTMLElement.h"
 #include "HTMLNames.h"
@@ -42,7 +43,7 @@
     , m_ownsInfo(false)
     , m_type(type)
     , m_base(document)
-    , m_info(document->collectionInfo(type))
+    , m_info(0)
 {
 }
 

Modified: trunk/Source/WebCore/html/HTMLOptionsCollection.cpp (103863 => 103864)


--- trunk/Source/WebCore/html/HTMLOptionsCollection.cpp	2011-12-31 23:41:55 UTC (rev 103863)
+++ trunk/Source/WebCore/html/HTMLOptionsCollection.cpp	2012-01-01 00:50:00 UTC (rev 103864)
@@ -21,6 +21,7 @@
 #include "config.h"
 #include "HTMLOptionsCollection.h"
 
+#include "CollectionCache.h"
 #include "ExceptionCode.h"
 #include "HTMLOptionElement.h"
 #include "HTMLSelectElement.h"
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to