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

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

Issue 1858753003: Remove RawPtr from core/css (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // FIXME: In the future, we want to take much more than deviceScaleFacto r into acount here. 115 // FIXME: In the future, we want to take much more than deviceScaleFacto r into acount here.
116 // All forms of scale should be included: Page::pageScaleFactor(), Local Frame::pageZoomFactor(), 116 // All forms of scale should be included: Page::pageScaleFactor(), Local Frame::pageZoomFactor(),
117 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 117 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698
118 ImageWithScale image = bestImageForScaleFactor(deviceScaleFactor); 118 ImageWithScale image = bestImageForScaleFactor(deviceScaleFactor);
119 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR L)), FetchInitiatorTypeNames::css); 119 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR L)), FetchInitiatorTypeNames::css);
120 request.mutableResourceRequest().setHTTPReferrer(image.referrer); 120 request.mutableResourceRequest().setHTTPReferrer(image.referrer);
121 121
122 if (crossOrigin != CrossOriginAttributeNotSet) 122 if (crossOrigin != CrossOriginAttributeNotSet)
123 request.setCrossOriginAccessControl(document->getSecurityOrigin(), c rossOrigin); 123 request.setCrossOriginAccessControl(document->getSecurityOrigin(), c rossOrigin);
124 124
125 if (RawPtr<ImageResource> cachedImage = ImageResource::fetch(request, do cument->fetcher())) 125 if (ImageResource* cachedImage = ImageResource::fetch(request, document- >fetcher()))
126 m_cachedImage = StyleFetchedImageSet::create(cachedImage.get(), imag e.scaleFactor, this, request.url()); 126 m_cachedImage = StyleFetchedImageSet::create(cachedImage, image.scal eFactor, this, request.url());
127 else 127 else
128 m_cachedImage = StyleInvalidImage::create(image.imageURL); 128 m_cachedImage = StyleInvalidImage::create(image.imageURL);
129 m_cachedScaleFactor = deviceScaleFactor; 129 m_cachedScaleFactor = deviceScaleFactor;
130 } 130 }
131 131
132 return m_cachedImage.get(); 132 return m_cachedImage.get();
133 } 133 }
134 134
135 String CSSImageSetValue::customCSSText() const 135 String CSSImageSetValue::customCSSText() const
136 { 136 {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 return cachedResource->loadFailedOrCanceled(); 170 return cachedResource->loadFailedOrCanceled();
171 return true; 171 return true;
172 } 172 }
173 173
174 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue) 174 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue)
175 { 175 {
176 visitor->trace(m_cachedImage); 176 visitor->trace(m_cachedImage);
177 CSSValueList::traceAfterDispatch(visitor); 177 CSSValueList::traceAfterDispatch(visitor);
178 } 178 }
179 179
180 RawPtr<CSSImageSetValue> CSSImageSetValue::valueWithURLsMadeAbsolute() 180 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute()
181 { 181 {
182 RawPtr<CSSImageSetValue> value = CSSImageSetValue::create(); 182 CSSImageSetValue* value = CSSImageSetValue::create();
183 for (auto& item : *this) 183 for (auto& item : *this)
184 item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURL MadeAbsolute()) : value->append(item); 184 item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURL MadeAbsolute()) : value->append(item);
185 return value.release(); 185 return value;
186 } 186 }
187 187
188 188
189 } // namespace blink 189 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageSetValue.h ('k') | third_party/WebKit/Source/core/css/CSSImageValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698