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

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

Issue 14672042: Prepare to add more initiator info to CachedResource(Request) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSFontFaceSrcValue.cpp ('k') | Source/core/css/CSSImageValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 m_scaleFactor = 1; 101 m_scaleFactor = 1;
102 102
103 if (!m_imagesInSet.size()) 103 if (!m_imagesInSet.size())
104 fillImageSet(); 104 fillImageSet();
105 105
106 if (!m_accessedBestFitImage) { 106 if (!m_accessedBestFitImage) {
107 // FIXME: In the future, we want to take much more than deviceScaleFacto r into acount here. 107 // FIXME: In the future, we want to take much more than deviceScaleFacto r into acount here.
108 // All forms of scale should be included: Page::pageScaleFactor(), Frame ::pageZoomFactor(), 108 // All forms of scale should be included: Page::pageScaleFactor(), 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 CachedResourceRequest request(ResourceRequest(document->completeURL(imag e.imageURL))); 111 CachedResourceRequest request(ResourceRequest(document->completeURL(imag e.imageURL)), cachedResourceRequestInitiators().css);
112 request.setInitiator(cachedResourceRequestInitiators().css);
113 if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage (request)) { 112 if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage (request)) {
114 m_imageSet = StyleCachedImageSet::create(cachedImage.get(), image.sc aleFactor, this); 113 m_imageSet = StyleCachedImageSet::create(cachedImage.get(), image.sc aleFactor, this);
115 m_accessedBestFitImage = true; 114 m_accessedBestFitImage = true;
116 } 115 }
117 } 116 }
118 117
119 return (m_imageSet && m_imageSet->isCachedImageSet()) ? static_cast<StyleCac hedImageSet*>(m_imageSet.get()) : 0; 118 return (m_imageSet && m_imageSet->isCachedImageSet()) ? static_cast<StyleCac hedImageSet*>(m_imageSet.get()) : 0;
120 } 119 }
121 120
122 StyleImage* CSSImageSetValue::cachedOrPendingImageSet(Document* document) 121 StyleImage* CSSImageSetValue::cachedOrPendingImageSet(Document* document)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 info.addMember(m_imagesInSet, "imagesInSet"); 197 info.addMember(m_imagesInSet, "imagesInSet");
199 } 198 }
200 199
201 void CSSImageSetValue::ImageWithScale::reportMemoryUsage(MemoryObjectInfo* memor yObjectInfo) const 200 void CSSImageSetValue::ImageWithScale::reportMemoryUsage(MemoryObjectInfo* memor yObjectInfo) const
202 { 201 {
203 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); 202 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
204 info.addMember(imageURL, "imageURL"); 203 info.addMember(imageURL, "imageURL");
205 } 204 }
206 205
207 } // namespace WebCore 206 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontFaceSrcValue.cpp ('k') | Source/core/css/CSSImageValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698