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

Side by Side Diff: third_party/WebKit/Source/core/dom/StaticNodeList.h

Issue 2652923002: Devirtualize Visitor and remove inline visitor specialization. (Closed)
Patch Set: rebased Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 template <typename NodeType> 75 template <typename NodeType>
76 NodeType* StaticNodeTypeList<NodeType>::item(unsigned index) const { 76 NodeType* StaticNodeTypeList<NodeType>::item(unsigned index) const {
77 if (index < m_nodes.size()) 77 if (index < m_nodes.size())
78 return m_nodes[index].get(); 78 return m_nodes[index].get();
79 return 0; 79 return 0;
80 } 80 }
81 81
82 template <typename NodeType> 82 template <typename NodeType>
83 void StaticNodeTypeList<NodeType>::trace(Visitor* visitor) { 83 void StaticNodeTypeList<NodeType>::trace(Visitor* visitor) {
84 traceImpl(visitor);
85 }
86 template <typename NodeType>
87 void StaticNodeTypeList<NodeType>::trace(InlinedGlobalMarkingVisitor visitor) {
88 traceImpl(visitor);
89 }
90
91 template <typename NodeType>
92 template <typename VisitorDispatcher>
93 ALWAYS_INLINE void StaticNodeTypeList<NodeType>::traceImpl(
94 VisitorDispatcher visitor) {
95 visitor->trace(m_nodes); 84 visitor->trace(m_nodes);
96 NodeList::trace(visitor); 85 NodeList::trace(visitor);
97 } 86 }
98 87
99 } // namespace blink 88 } // namespace blink
100 89
101 #endif // StaticNodeList_h 90 #endif // StaticNodeList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698