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

Side by Side Diff: Source/core/dom/NodeListsNodeData.h

Issue 1304043002: Make classes and structures in core/dom fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/NodeTraversal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 void removeEmptyChildNodeList(EmptyNodeList* list) 73 void removeEmptyChildNodeList(EmptyNodeList* list)
74 { 74 {
75 ASSERT(m_childNodeList == list); 75 ASSERT(m_childNodeList == list);
76 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de())) 76 if (deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList(list->ownerNo de()))
77 return; 77 return;
78 m_childNodeList = nullptr; 78 m_childNodeList = nullptr;
79 } 79 }
80 #endif 80 #endif
81 81
82 struct NodeListAtomicCacheMapEntryHash { 82 struct NodeListAtomicCacheMapEntryHash {
83 STATIC_ONLY(NodeListAtomicCacheMapEntryHash);
83 static unsigned hash(const std::pair<unsigned char, StringImpl*>& entry) 84 static unsigned hash(const std::pair<unsigned char, StringImpl*>& entry)
84 { 85 {
85 return DefaultHash<StringImpl*>::Hash::hash(entry.second) + entry.fi rst; 86 return DefaultHash<StringImpl*>::Hash::hash(entry.second) + entry.fi rst;
86 } 87 }
87 static bool equal(const std::pair<unsigned char, StringImpl*>& a, const std::pair<unsigned char, StringImpl*>& b) { return a == b; } 88 static bool equal(const std::pair<unsigned char, StringImpl*>& a, const std::pair<unsigned char, StringImpl*>& b) { return a == b; }
88 static const bool safeToCompareToEmptyOrDeleted = DefaultHash<StringImpl *>::Hash::safeToCompareToEmptyOrDeleted; 89 static const bool safeToCompareToEmptyOrDeleted = DefaultHash<StringImpl *>::Hash::safeToCompareToEmptyOrDeleted;
89 }; 90 };
90 91
91 // Oilpan: keep a weak reference to the collection objects. 92 // Oilpan: keep a weak reference to the collection objects.
92 // Explicit object unregistration in a non-Oilpan setting 93 // Explicit object unregistration in a non-Oilpan setting
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 template <typename Collection> 259 template <typename Collection>
259 inline Collection* ContainerNode::cachedCollection(CollectionType type) 260 inline Collection* ContainerNode::cachedCollection(CollectionType type)
260 { 261 {
261 NodeListsNodeData* nodeLists = this->nodeLists(); 262 NodeListsNodeData* nodeLists = this->nodeLists();
262 return nodeLists ? nodeLists->cached<Collection>(type) : 0; 263 return nodeLists ? nodeLists->cached<Collection>(type) : 0;
263 } 264 }
264 265
265 } // namespace blink 266 } // namespace blink
266 267
267 #endif // NodeListsNodeData_h 268 #endif // NodeListsNodeData_h
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/NodeTraversal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698