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

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

Issue 2036943002: Reduced the callers to the non-const version of CSSValueList::item() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_make_cssvaluelist_take_const_ref
Patch Set: Rebase Created 4 years, 6 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 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 CSSImageSetValue::~CSSImageSetValue() 51 CSSImageSetValue::~CSSImageSetValue()
52 { 52 {
53 } 53 }
54 54
55 void CSSImageSetValue::fillImageSet() 55 void CSSImageSetValue::fillImageSet()
56 { 56 {
57 size_t length = this->length(); 57 size_t length = this->length();
58 size_t i = 0; 58 size_t i = 0;
59 while (i < length) { 59 while (i < length) {
60 CSSImageValue* imageValue = toCSSImageValue(item(i)); 60 const CSSImageValue* imageValue = toCSSImageValue(item(i));
61 String imageURL = imageValue->url(); 61 String imageURL = imageValue->url();
62 62
63 ++i; 63 ++i;
64 ASSERT_WITH_SECURITY_IMPLICATION(i < length); 64 ASSERT_WITH_SECURITY_IMPLICATION(i < length);
65 CSSValue* scaleFactorValue = item(i); 65 const CSSValue* scaleFactorValue = item(i);
66 float scaleFactor = toCSSPrimitiveValue(scaleFactorValue)->getFloatValue (); 66 float scaleFactor = toCSSPrimitiveValue(scaleFactorValue)->getFloatValue ();
67 67
68 ImageWithScale image; 68 ImageWithScale image;
69 image.imageURL = imageURL; 69 image.imageURL = imageURL;
70 image.referrer = SecurityPolicy::generateReferrer(imageValue->referrer() .referrerPolicy, KURL(ParsedURLString, imageURL), imageValue->referrer().referre r); 70 image.referrer = SecurityPolicy::generateReferrer(imageValue->referrer() .referrerPolicy, KURL(ParsedURLString, imageURL), imageValue->referrer().referre r);
71 image.scaleFactor = scaleFactor; 71 image.scaleFactor = scaleFactor;
72 m_imagesInSet.append(image); 72 m_imagesInSet.append(image);
73 ++i; 73 ++i;
74 } 74 }
75 75
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute() 176 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute()
177 { 177 {
178 CSSImageSetValue* value = CSSImageSetValue::create(); 178 CSSImageSetValue* value = CSSImageSetValue::create();
179 for (auto& item : *this) 179 for (auto& item : *this)
180 item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURL MadeAbsolute()) : value->append(item); 180 item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURL MadeAbsolute()) : value->append(item);
181 return value; 181 return value;
182 } 182 }
183 183
184 184
185 } // namespace blink 185 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSValueList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698