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

Side by Side Diff: Source/core/html/HTMLCollection.cpp

Issue 23983034: [oilpan] Handlify Node raw pointers in html/ and subclasses of dom/LiveNodeList. (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r ights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r ights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 case TagNodeListType: 153 case TagNodeListType:
154 case HTMLTagNodeListType: 154 case HTMLTagNodeListType:
155 case RadioNodeListType: 155 case RadioNodeListType:
156 case LabelsNodeListType: 156 case LabelsNodeListType:
157 break; 157 break;
158 } 158 }
159 ASSERT_NOT_REACHED(); 159 ASSERT_NOT_REACHED();
160 return DoNotInvalidateOnAttributeChanges; 160 return DoNotInvalidateOnAttributeChanges;
161 } 161 }
162 162
163 HTMLCollection::HTMLCollection(Node* ownerNode, CollectionType type, ItemAfterOv errideType itemAfterOverrideType) 163 HTMLCollection::HTMLCollection(const Handle<Node>& ownerNode, CollectionType typ e, ItemAfterOverrideType itemAfterOverrideType)
164 : LiveNodeListBase(ownerNode, rootTypeFromCollectionType(type), invalidation TypeExcludingIdAndNameAttributes(type), 164 : LiveNodeListBase(ownerNode, rootTypeFromCollectionType(type), invalidation TypeExcludingIdAndNameAttributes(type),
165 WebCore::shouldOnlyIncludeDirectChildren(type), type, itemAfterOverrideT ype) 165 WebCore::shouldOnlyIncludeDirectChildren(type), type, itemAfterOverrideT ype)
166 { 166 {
167 ScriptWrappable::init(this); 167 ScriptWrappable::init(this);
168 } 168 }
169 169
170 PassRefPtr<HTMLCollection> HTMLCollection::create(Node* base, CollectionType typ e) 170 PassRefPtr<HTMLCollection> HTMLCollection::create(const Handle<Node>& base, Coll ectionType type)
171 { 171 {
172 return adoptRef(new HTMLCollection(base, type, DoesNotOverrideItemAfter)); 172 return adoptRef(new HTMLCollection(base, type, DoesNotOverrideItemAfter));
173 } 173 }
174 174
175 HTMLCollection::~HTMLCollection() 175 HTMLCollection::~HTMLCollection()
176 { 176 {
177 // HTMLNameCollection removes cache by itself. 177 // HTMLNameCollection removes cache by itself.
178 if (type() != WindowNamedItems && type() != DocumentNamedItems) 178 if (type() != WindowNamedItems && type() != DocumentNamedItems)
179 ownerNode()->nodeLists()->removeCacheWithAtomicName(this, type()); 179 ownerNode()->nodeLists()->removeCacheWithAtomicName(this, type());
180 } 180 }
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 740
741 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, const Ha ndle<Element>& element) 741 void HTMLCollection::append(NodeCacheMap& map, const AtomicString& key, const Ha ndle<Element>& element)
742 { 742 {
743 OwnPtr<CollectionRoot<Vector<Member<Element> > > >& elementVector = map.add( key.impl(), nullptr).iterator->value; 743 OwnPtr<CollectionRoot<Vector<Member<Element> > > >& elementVector = map.add( key.impl(), nullptr).iterator->value;
744 if (!elementVector) 744 if (!elementVector)
745 elementVector = adoptPtr(new CollectionRoot<Vector<Member<Element> > >) ; 745 elementVector = adoptPtr(new CollectionRoot<Vector<Member<Element> > >) ;
746 (*elementVector)->append(element); 746 (*elementVector)->append(element);
747 } 747 }
748 748
749 } // namespace WebCore 749 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698