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

Side by Side Diff: Source/core/svg/SVGElementInstance.h

Issue 49153006: Have ContainerNodeAlgorithms deal with references instead of pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 3 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
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 11 matching lines...) Expand all
22 #define SVGElementInstance_h 22 #define SVGElementInstance_h
23 23
24 #include "bindings/v8/ScriptWrappable.h" 24 #include "bindings/v8/ScriptWrappable.h"
25 #include "core/dom/TreeShared.h" 25 #include "core/dom/TreeShared.h"
26 #include "core/events/EventTarget.h" 26 #include "core/events/EventTarget.h"
27 27
28 namespace WebCore { 28 namespace WebCore {
29 29
30 namespace Private { 30 namespace Private {
31 template<class GenericNode, class GenericNodeContainer> 31 template<class GenericNode, class GenericNodeContainer>
32 void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, Generi cNodeContainer* container); 32 void addChildNodesToDeletionQueue(GenericNode*& head, GenericNode*& tail, Generi cNodeContainer&);
33 }; 33 };
34 34
35 class Document; 35 class Document;
36 class SVGElement; 36 class SVGElement;
37 class SVGElementInstanceList; 37 class SVGElementInstanceList;
38 class SVGUseElement; 38 class SVGUseElement;
39 39
40 // SVGElementInstance mimics Node, but without providing all its functionality 40 // SVGElementInstance mimics Node, but without providing all its functionality
41 class SVGElementInstance : public EventTarget, public ScriptWrappable, public Tr eeShared<SVGElementInstance> { 41 class SVGElementInstance : public EventTarget, public ScriptWrappable, public Tr eeShared<SVGElementInstance> {
42 DEFINE_EVENT_TARGET_REFCOUNTING(TreeShared<SVGElementInstance>); 42 DEFINE_EVENT_TARGET_REFCOUNTING(TreeShared<SVGElementInstance>);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 void removedLastRef(); 150 void removedLastRef();
151 bool hasTreeSharedParent() const { return !!m_parentInstance; } 151 bool hasTreeSharedParent() const { return !!m_parentInstance; }
152 152
153 virtual Node* toNode(); 153 virtual Node* toNode();
154 154
155 void appendChild(PassRefPtr<SVGElementInstance> child); 155 void appendChild(PassRefPtr<SVGElementInstance> child);
156 void setShadowTreeElement(SVGElement*); 156 void setShadowTreeElement(SVGElement*);
157 157
158 template<class GenericNode, class GenericNodeContainer> 158 template<class GenericNode, class GenericNodeContainer>
159 friend void appendChildToContainer(GenericNode* child, GenericNodeContainer* container); 159 friend void appendChildToContainer(GenericNode& child, GenericNodeContainer& );
160 160
161 template<class GenericNode, class GenericNodeContainer> 161 template<class GenericNode, class GenericNodeContainer>
162 friend void removeDetachedChildrenInContainer(GenericNodeContainer*); 162 friend void removeDetachedChildrenInContainer(GenericNodeContainer&);
163 163
164 template<class GenericNode, class GenericNodeContainer> 164 template<class GenericNode, class GenericNodeContainer>
165 friend void Private::addChildNodesToDeletionQueue(GenericNode*& head, Generi cNode*& tail, GenericNodeContainer* container); 165 friend void Private::addChildNodesToDeletionQueue(GenericNode*& head, Generi cNode*& tail, GenericNodeContainer&);
166 166
167 bool hasChildNodes() const { return m_firstChild; } 167 bool hasChildNodes() const { return m_firstChild; }
168 168
169 void setFirstChild(SVGElementInstance* child) { m_firstChild = child; } 169 void setFirstChild(SVGElementInstance* child) { m_firstChild = child; }
170 void setLastChild(SVGElementInstance* child) { m_lastChild = child; } 170 void setLastChild(SVGElementInstance* child) { m_lastChild = child; }
171 171
172 void setNextSibling(SVGElementInstance* sibling) { m_nextSibling = sibling; } 172 void setNextSibling(SVGElementInstance* sibling) { m_nextSibling = sibling; }
173 void setPreviousSibling(SVGElementInstance* sibling) { m_previousSibling = s ibling; } 173 void setPreviousSibling(SVGElementInstance* sibling) { m_previousSibling = s ibling; }
174 174
175 virtual EventTargetData* eventTargetData() OVERRIDE; 175 virtual EventTargetData* eventTargetData() OVERRIDE;
176 virtual EventTargetData& ensureEventTargetData() OVERRIDE; 176 virtual EventTargetData& ensureEventTargetData() OVERRIDE;
177 177
178 SVGElementInstance* m_parentInstance; 178 SVGElementInstance* m_parentInstance;
179 179
180 SVGUseElement* m_correspondingUseElement; 180 SVGUseElement* m_correspondingUseElement;
181 SVGUseElement* m_directUseElement; 181 SVGUseElement* m_directUseElement;
182 RefPtr<SVGElement> m_element; 182 RefPtr<SVGElement> m_element;
183 RefPtr<SVGElement> m_shadowTreeElement; 183 RefPtr<SVGElement> m_shadowTreeElement;
184 184
185 SVGElementInstance* m_previousSibling; 185 SVGElementInstance* m_previousSibling;
186 SVGElementInstance* m_nextSibling; 186 SVGElementInstance* m_nextSibling;
187 187
188 SVGElementInstance* m_firstChild; 188 SVGElementInstance* m_firstChild;
189 SVGElementInstance* m_lastChild; 189 SVGElementInstance* m_lastChild;
190 }; 190 };
191 191
192 } // namespace WebCore 192 } // namespace WebCore
193 193
194 #endif 194 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698