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

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

Issue 290333008: Oilpan: add [WillBeGarbageCollected] for Element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + remove WebNode FIXME Created 6 years, 7 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/html/HTMLAllCollection.h ('k') | Source/core/html/HTMLFormControlsCollection.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) 2009, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2011, 2012 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 if (WillBeHeapVector<RawPtrWillBeMember<Element> >* elements = cache.getElem entsByName(name)) { 60 if (WillBeHeapVector<RawPtrWillBeMember<Element> >* elements = cache.getElem entsByName(name)) {
61 if (index < elements->size()) 61 if (index < elements->size())
62 return elements->at(index); 62 return elements->at(index);
63 } 63 }
64 64
65 return 0; 65 return 0;
66 } 66 }
67 67
68 void HTMLAllCollection::namedGetter(const AtomicString& name, bool& returnValue0 Enabled, RefPtrWillBeRawPtr<NodeList>& returnValue0, bool& returnValue1Enabled, RefPtr<Element>& returnValue1) 68 void HTMLAllCollection::namedGetter(const AtomicString& name, bool& returnValue0 Enabled, RefPtrWillBeRawPtr<NodeList>& returnValue0, bool& returnValue1Enabled, RefPtrWillBeRawPtr<Element>& returnValue1)
69 { 69 {
70 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems; 70 WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems;
71 this->namedItems(name, namedItems); 71 this->namedItems(name, namedItems);
72 72
73 if (!namedItems.size()) 73 if (!namedItems.size())
74 return; 74 return;
75 75
76 if (namedItems.size() == 1) { 76 if (namedItems.size() == 1) {
77 returnValue1Enabled = true; 77 returnValue1Enabled = true;
78 // FIXME: Oilpan: remove the call to |get| when Element becomes [Garbage Collected]. 78 returnValue1 = namedItems.at(0);
79 returnValue1 = namedItems.at(0).get();
80 return; 79 return;
81 } 80 }
82 81
83 // FIXME: HTML5 specification says this should be a HTMLCollection. 82 // FIXME: HTML5 specification says this should be a HTMLCollection.
84 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#htmlallcollection 83 // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-in terfaces.html#htmlallcollection
85 returnValue0Enabled = true; 84 returnValue0Enabled = true;
86 returnValue0 = NamedNodesCollection::create(namedItems); 85 returnValue0 = NamedNodesCollection::create(namedItems);
87 } 86 }
88 87
89 } // namespace WebCore 88 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAllCollection.h ('k') | Source/core/html/HTMLFormControlsCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698