Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: Source/WebCore/dom/Document.cpp

Issue 10695128: Merge 120979 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/dom/DynamicNodeList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/Document.cpp
===================================================================
--- Source/WebCore/dom/Document.cpp (revision 122245)
+++ Source/WebCore/dom/Document.cpp (working copy)
@@ -5926,32 +5926,12 @@
#if ENABLE(MICRODATA)
PassRefPtr<NodeList> Document::getItems(const String& typeNames)
{
- NodeListsNodeData* nodeLists = ensureRareData()->ensureNodeLists(this);
-
// Since documet.getItem() is allowed for microdata, typeNames will be null string.
// In this case we need to create an unique string identifier to map such request in the cache.
String localTypeNames = typeNames.isNull() ? String("http://webkit.org/microdata/undefinedItemType") : typeNames;
- NodeListsNodeData::MicroDataItemListCache::AddResult result = nodeLists->m_microDataItemListCache.add(localTypeNames, 0);
- if (!result.isNewEntry)
- return PassRefPtr<NodeList>(result.iterator->second);
-
- RefPtr<MicroDataItemList> list = MicroDataItemList::create(this, typeNames);
- result.iterator->second = list.get();
- return list.release();
+ return ensureRareData()->ensureNodeLists(this)->addCacheWithName<MicroDataItemList>(this, DynamicNodeList::MicroDataItemListType, localTypeNames);
}
-
-void Document::removeCachedMicroDataItemList(MicroDataItemList* list, const String& typeNames)
-{
- ASSERT(rareData());
- ASSERT(rareData()->nodeLists());
-
- NodeListsNodeData* data = rareData()->nodeLists();
-
- String localTypeNames = typeNames.isNull() ? String("http://webkit.org/microdata/undefinedItemType") : typeNames;
- ASSERT_UNUSED(list, list == data->m_microDataItemListCache.get(localTypeNames));
- data->m_microDataItemListCache.remove(localTypeNames);
-}
#endif
IntSize Document::viewportSize() const
« no previous file with comments | « Source/WebCore/dom/Document.h ('k') | Source/WebCore/dom/DynamicNodeList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698