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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSImageSetValue.cpp

Issue 2566403003: Migrate WTF::Vector::append() to ::push_back() [part 3 of N] (Closed)
Patch Set: Created 4 years 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 Apple Inc. All rights reserved. 2 * Copyright (C) 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 SECURITY_DCHECK(i < length); 59 SECURITY_DCHECK(i < length);
60 const CSSValue& scaleFactorValue = item(i); 60 const CSSValue& scaleFactorValue = item(i);
61 float scaleFactor = toCSSPrimitiveValue(scaleFactorValue).getFloatValue(); 61 float scaleFactor = toCSSPrimitiveValue(scaleFactorValue).getFloatValue();
62 62
63 ImageWithScale image; 63 ImageWithScale image;
64 image.imageURL = imageURL; 64 image.imageURL = imageURL;
65 image.referrer = SecurityPolicy::generateReferrer( 65 image.referrer = SecurityPolicy::generateReferrer(
66 imageValue.referrer().referrerPolicy, KURL(ParsedURLString, imageURL), 66 imageValue.referrer().referrerPolicy, KURL(ParsedURLString, imageURL),
67 imageValue.referrer().referrer); 67 imageValue.referrer().referrer);
68 image.scaleFactor = scaleFactor; 68 image.scaleFactor = scaleFactor;
69 m_imagesInSet.append(image); 69 m_imagesInSet.push_back(image);
70 ++i; 70 ++i;
71 } 71 }
72 72
73 // Sort the images so that they are stored in order from lowest resolution to 73 // Sort the images so that they are stored in order from lowest resolution to
74 // highest. 74 // highest.
75 std::sort(m_imagesInSet.begin(), m_imagesInSet.end(), 75 std::sort(m_imagesInSet.begin(), m_imagesInSet.end(),
76 CSSImageSetValue::compareByScaleFactor); 76 CSSImageSetValue::compareByScaleFactor);
77 } 77 }
78 78
79 CSSImageSetValue::ImageWithScale CSSImageSetValue::bestImageForScaleFactor( 79 CSSImageSetValue::ImageWithScale CSSImageSetValue::bestImageForScaleFactor(
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute() { 178 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute() {
179 CSSImageSetValue* value = CSSImageSetValue::create(); 179 CSSImageSetValue* value = CSSImageSetValue::create();
180 for (auto& item : *this) 180 for (auto& item : *this)
181 item->isImageValue() 181 item->isImageValue()
182 ? value->append(*toCSSImageValue(*item).valueWithURLMadeAbsolute()) 182 ? value->append(*toCSSImageValue(*item).valueWithURLMadeAbsolute())
183 : value->append(*item); 183 : value->append(*item);
184 return value; 184 return value;
185 } 185 }
186 186
187 } // namespace blink 187 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGradientValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698