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

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

Issue 1339183003: NOT FOR LANDING Experiment with allocating SVGImageForContainer on demand (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 3 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // All forms of scale should be included: Page::pageScaleFactor(), Local Frame::pageZoomFactor(), 108 // All forms of scale should be included: Page::pageScaleFactor(), Local Frame::pageZoomFactor(),
109 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 109 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698
110 ImageWithScale image = bestImageForScaleFactor(); 110 ImageWithScale image = bestImageForScaleFactor();
111 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR L)), FetchInitiatorTypeNames::css, options); 111 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR L)), FetchInitiatorTypeNames::css, options);
112 request.mutableResourceRequest().setHTTPReferrer(image.referrer); 112 request.mutableResourceRequest().setHTTPReferrer(image.referrer);
113 113
114 if (options.corsEnabled == IsCORSEnabled) 114 if (options.corsEnabled == IsCORSEnabled)
115 request.setCrossOriginAccessControl(document->securityOrigin(), opti ons.allowCredentials, options.credentialsRequested); 115 request.setCrossOriginAccessControl(document->securityOrigin(), opti ons.allowCredentials, options.credentialsRequested);
116 116
117 if (ResourcePtr<ImageResource> cachedImage = ImageResource::fetch(reques t, document->fetcher())) { 117 if (ResourcePtr<ImageResource> cachedImage = ImageResource::fetch(reques t, document->fetcher())) {
118 m_imageSet = StyleFetchedImageSet::create(cachedImage.get(), image.s caleFactor, this); 118 m_imageSet = StyleFetchedImageSet::create(cachedImage.get(), image.s caleFactor, this, request.url());
119 m_accessedBestFitImage = true; 119 m_accessedBestFitImage = true;
120 } 120 }
121 } 121 }
122 122
123 return (m_imageSet && m_imageSet->isImageResourceSet()) ? toStyleFetchedImag eSet(m_imageSet) : nullptr; 123 return (m_imageSet && m_imageSet->isImageResourceSet()) ? toStyleFetchedImag eSet(m_imageSet) : nullptr;
124 } 124 }
125 125
126 StyleFetchedImageSet* CSSImageSetValue::cachedImageSet(Document* document, float deviceScaleFactor) 126 StyleFetchedImageSet* CSSImageSetValue::cachedImageSet(Document* document, float deviceScaleFactor)
127 { 127 {
128 return cachedImageSet(document, deviceScaleFactor, ResourceFetcher::defaultR esourceOptions()); 128 return cachedImageSet(document, deviceScaleFactor, ResourceFetcher::defaultR esourceOptions());
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 return true; 182 return true;
183 } 183 }
184 184
185 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue) 185 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue)
186 { 186 {
187 visitor->trace(m_imageSet); 187 visitor->trace(m_imageSet);
188 CSSValueList::traceAfterDispatch(visitor); 188 CSSValueList::traceAfterDispatch(visitor);
189 } 189 }
190 190
191 } // namespace blink 191 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/svg/zoom/page/zoom-svg-as-background-with-relative-size.html ('k') | Source/core/css/CSSImageValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698