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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2617783002: Migrate WTF::Vector::append() to ::push_back() [part 12 of N] (Closed)
Patch Set: rebase 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 1470
1471 Vector<AtomicString> Internals::userPreferredLanguages() const { 1471 Vector<AtomicString> Internals::userPreferredLanguages() const {
1472 return blink::userPreferredLanguages(); 1472 return blink::userPreferredLanguages();
1473 } 1473 }
1474 1474
1475 // Optimally, the bindings generator would pass a Vector<AtomicString> here but 1475 // Optimally, the bindings generator would pass a Vector<AtomicString> here but
1476 // this is not supported yet. 1476 // this is not supported yet.
1477 void Internals::setUserPreferredLanguages(const Vector<String>& languages) { 1477 void Internals::setUserPreferredLanguages(const Vector<String>& languages) {
1478 Vector<AtomicString> atomicLanguages; 1478 Vector<AtomicString> atomicLanguages;
1479 for (size_t i = 0; i < languages.size(); ++i) 1479 for (size_t i = 0; i < languages.size(); ++i)
1480 atomicLanguages.append(AtomicString(languages[i])); 1480 atomicLanguages.push_back(AtomicString(languages[i]));
1481 overrideUserPreferredLanguages(atomicLanguages); 1481 overrideUserPreferredLanguages(atomicLanguages);
1482 } 1482 }
1483 1483
1484 unsigned Internals::mediaKeysCount() { 1484 unsigned Internals::mediaKeysCount() {
1485 return InstanceCounters::counterValue(InstanceCounters::MediaKeysCounter); 1485 return InstanceCounters::counterValue(InstanceCounters::MediaKeysCounter);
1486 } 1486 }
1487 1487
1488 unsigned Internals::mediaKeySessionCount() { 1488 unsigned Internals::mediaKeySessionCount() {
1489 return InstanceCounters::counterValue( 1489 return InstanceCounters::counterValue(
1490 InstanceCounters::MediaKeySessionCounter); 1490 InstanceCounters::MediaKeySessionCounter);
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 return PrintContext::pageNumberForElement(element, 2120 return PrintContext::pageNumberForElement(element,
2121 FloatSize(pageWidth, pageHeight)); 2121 FloatSize(pageWidth, pageHeight));
2122 } 2122 }
2123 2123
2124 Vector<String> Internals::iconURLs(Document* document, 2124 Vector<String> Internals::iconURLs(Document* document,
2125 int iconTypesMask) const { 2125 int iconTypesMask) const {
2126 Vector<IconURL> iconURLs = document->iconURLs(iconTypesMask); 2126 Vector<IconURL> iconURLs = document->iconURLs(iconTypesMask);
2127 Vector<String> array; 2127 Vector<String> array;
2128 2128
2129 for (auto& iconURL : iconURLs) 2129 for (auto& iconURL : iconURLs)
2130 array.append(iconURL.m_iconURL.getString()); 2130 array.push_back(iconURL.m_iconURL.getString());
2131 2131
2132 return array; 2132 return array;
2133 } 2133 }
2134 2134
2135 Vector<String> Internals::shortcutIconURLs(Document* document) const { 2135 Vector<String> Internals::shortcutIconURLs(Document* document) const {
2136 return iconURLs(document, Favicon); 2136 return iconURLs(document, Favicon);
2137 } 2137 }
2138 2138
2139 Vector<String> Internals::allIconURLs(Document* document) const { 2139 Vector<String> Internals::allIconURLs(Document* document) const {
2140 return iconURLs(document, Favicon | TouchIcon | TouchPrecomposedIcon); 2140 return iconURLs(document, Favicon | TouchIcon | TouchPrecomposedIcon);
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 return ClientRectList::create(); 2433 return ClientRectList::create();
2434 } 2434 }
2435 2435
2436 document->updateStyleAndLayout(); 2436 document->updateStyleAndLayout();
2437 document->view()->updateDocumentAnnotatedRegions(); 2437 document->view()->updateDocumentAnnotatedRegions();
2438 Vector<AnnotatedRegionValue> regions = document->annotatedRegions(); 2438 Vector<AnnotatedRegionValue> regions = document->annotatedRegions();
2439 2439
2440 Vector<FloatQuad> quads; 2440 Vector<FloatQuad> quads;
2441 for (size_t i = 0; i < regions.size(); ++i) { 2441 for (size_t i = 0; i < regions.size(); ++i) {
2442 if (regions[i].draggable == draggable) 2442 if (regions[i].draggable == draggable)
2443 quads.append(FloatQuad(FloatRect(regions[i].bounds))); 2443 quads.push_back(FloatQuad(FloatRect(regions[i].bounds)));
2444 } 2444 }
2445 return ClientRectList::create(quads); 2445 return ClientRectList::create(quads);
2446 } 2446 }
2447 2447
2448 static const char* cursorTypeToString(Cursor::Type cursorType) { 2448 static const char* cursorTypeToString(Cursor::Type cursorType) {
2449 switch (cursorType) { 2449 switch (cursorType) {
2450 case Cursor::Pointer: 2450 case Cursor::Pointer:
2451 return "Pointer"; 2451 return "Pointer";
2452 case Cursor::Cross: 2452 case Cursor::Cross:
2453 return "Cross"; 2453 return "Cross";
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
3092 3092
3093 void Internals::crash() { 3093 void Internals::crash() {
3094 CHECK(false) << "Intentional crash"; 3094 CHECK(false) << "Intentional crash";
3095 } 3095 }
3096 3096
3097 void Internals::setIsLowEndDevice(bool isLowEndDevice) { 3097 void Internals::setIsLowEndDevice(bool isLowEndDevice) {
3098 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice); 3098 MemoryCoordinator::setIsLowEndDeviceForTesting(isLowEndDevice);
3099 } 3099 }
3100 3100
3101 } // namespace blink 3101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698