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

Side by Side Diff: third_party/WebKit/Source/web/WebDocument.cpp

Issue 2612903007: Migrate WTF::Vector::append() to ::push_back() [part 15 of N] (Closed)
Patch Set: Created 3 years, 11 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void WebDocument::forms(WebVector<WebFormElement>& results) const { 158 void WebDocument::forms(WebVector<WebFormElement>& results) const {
159 HTMLCollection* forms = 159 HTMLCollection* forms =
160 const_cast<Document*>(constUnwrap<Document>())->forms(); 160 const_cast<Document*>(constUnwrap<Document>())->forms();
161 size_t sourceLength = forms->length(); 161 size_t sourceLength = forms->length();
162 Vector<WebFormElement> temp; 162 Vector<WebFormElement> temp;
163 temp.reserveCapacity(sourceLength); 163 temp.reserveCapacity(sourceLength);
164 for (size_t i = 0; i < sourceLength; ++i) { 164 for (size_t i = 0; i < sourceLength; ++i) {
165 Element* element = forms->item(i); 165 Element* element = forms->item(i);
166 // Strange but true, sometimes node can be 0. 166 // Strange but true, sometimes node can be 0.
167 if (element && element->isHTMLElement()) 167 if (element && element->isHTMLElement())
168 temp.append(WebFormElement(toHTMLFormElement(element))); 168 temp.push_back(WebFormElement(toHTMLFormElement(element)));
169 } 169 }
170 results.assign(temp); 170 results.assign(temp);
171 } 171 }
172 172
173 WebURL WebDocument::completeURL(const WebString& partialURL) const { 173 WebURL WebDocument::completeURL(const WebString& partialURL) const {
174 return constUnwrap<Document>()->completeURL(partialURL); 174 return constUnwrap<Document>()->completeURL(partialURL);
175 } 175 }
176 176
177 WebElement WebDocument::getElementById(const WebString& id) const { 177 WebElement WebDocument::getElementById(const WebString& id) const {
178 return WebElement(constUnwrap<Document>()->getElementById(id)); 178 return WebElement(constUnwrap<Document>()->getElementById(id));
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 WebDocument& WebDocument::operator=(Document* elem) { 296 WebDocument& WebDocument::operator=(Document* elem) {
297 m_private = elem; 297 m_private = elem;
298 return *this; 298 return *this;
299 } 299 }
300 300
301 WebDocument::operator Document*() const { 301 WebDocument::operator Document*() const {
302 return toDocument(m_private.get()); 302 return toDocument(m_private.get());
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebDOMActivityLogger.cpp ('k') | third_party/WebKit/Source/web/WebFileChooserCompletionImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698