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

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

Issue 413763004: Get rid of unnecessary isChildNodeList() virtual call in clearChildNodeListCache() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | no next file » | 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 21 matching lines...) Expand all
32 #include "wtf/text/StringHash.h" 32 #include "wtf/text/StringHash.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 class NodeListsNodeData FINAL : public NoBaseWillBeGarbageCollectedFinalized<Nod eListsNodeData> { 36 class NodeListsNodeData FINAL : public NoBaseWillBeGarbageCollectedFinalized<Nod eListsNodeData> {
37 WTF_MAKE_NONCOPYABLE(NodeListsNodeData); 37 WTF_MAKE_NONCOPYABLE(NodeListsNodeData);
38 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; 38 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
39 public: 39 public:
40 void clearChildNodeListCache() 40 void clearChildNodeListCache()
41 { 41 {
42 if (m_childNodeList && m_childNodeList->isChildNodeList()) 42 if (m_childNodeList) {
43 // This can only be called from ContainerNode so casting to ChildNod eList
adamk 2014/07/24 22:06:20 This seems a bit unsafe, since there's nothing (ex
Inactive 2014/07/25 00:09:50 Yes, there is an assertion in the casting function
44 // is safe.
43 toChildNodeList(m_childNodeList)->invalidateCache(); 45 toChildNodeList(m_childNodeList)->invalidateCache();
46 }
44 } 47 }
45 48
46 PassRefPtrWillBeRawPtr<ChildNodeList> ensureChildNodeList(ContainerNode& nod e) 49 PassRefPtrWillBeRawPtr<ChildNodeList> ensureChildNodeList(ContainerNode& nod e)
47 { 50 {
48 if (m_childNodeList) 51 if (m_childNodeList)
49 return toChildNodeList(m_childNodeList); 52 return toChildNodeList(m_childNodeList);
50 RefPtrWillBeRawPtr<ChildNodeList> list = ChildNodeList::create(node); 53 RefPtrWillBeRawPtr<ChildNodeList> list = ChildNodeList::create(node);
51 m_childNodeList = list.get(); 54 m_childNodeList = list.get();
52 return list.release(); 55 return list.release();
53 } 56 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC acheNS.size() != 1) 235 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC acheNS.size() != 1)
233 return false; 236 return false;
234 ownerNode.clearNodeLists(); 237 ownerNode.clearNodeLists();
235 return true; 238 return true;
236 } 239 }
237 #endif 240 #endif
238 241
239 } // namespace blink 242 } // namespace blink
240 243
241 #endif // NodeListsNodeData_h 244 #endif // NodeListsNodeData_h
OLDNEW
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698