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

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

Issue 314893003: Set referrer for CSS resources (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/core/css/CSSFontFaceSrcValue.cpp ('k') | Source/core/css/CSSImageSetValue.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 10 matching lines...) Expand all
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE. 23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef CSSImageSetValue_h 26 #ifndef CSSImageSetValue_h
27 #define CSSImageSetValue_h 27 #define CSSImageSetValue_h
28 28
29 #include "core/css/CSSValueList.h" 29 #include "core/css/CSSValueList.h"
30 #include "core/fetch/ResourceFetcher.h" 30 #include "core/fetch/ResourceFetcher.h"
31 #include "platform/weborigin/Referrer.h"
31 32
32 namespace WebCore { 33 namespace WebCore {
33 34
34 class ResourceFetcher; 35 class ResourceFetcher;
35 class StyleFetchedImageSet; 36 class StyleFetchedImageSet;
36 class StyleImage; 37 class StyleImage;
37 38
38 class CSSImageSetValue : public CSSValueList { 39 class CSSImageSetValue : public CSSValueList {
39 public: 40 public:
40 41
41 static PassRefPtrWillBeRawPtr<CSSImageSetValue> create() 42 static PassRefPtrWillBeRawPtr<CSSImageSetValue> create()
42 { 43 {
43 return adoptRefWillBeNoop(new CSSImageSetValue()); 44 return adoptRefWillBeNoop(new CSSImageSetValue());
44 } 45 }
45 ~CSSImageSetValue(); 46 ~CSSImageSetValue();
46 47
47 StyleFetchedImageSet* cachedImageSet(ResourceFetcher*, float deviceScaleFact or, const ResourceLoaderOptions&); 48 StyleFetchedImageSet* cachedImageSet(ResourceFetcher*, float deviceScaleFact or, const ResourceLoaderOptions&);
48 StyleFetchedImageSet* cachedImageSet(ResourceFetcher*, float deviceScaleFact or); 49 StyleFetchedImageSet* cachedImageSet(ResourceFetcher*, float deviceScaleFact or);
49 50
50 // Returns a StyleFetchedImageSet if the best fit image has been cached alre ady, otherwise a StylePendingImage. 51 // Returns a StyleFetchedImageSet if the best fit image has been cached alre ady, otherwise a StylePendingImage.
51 StyleImage* cachedOrPendingImageSet(float); 52 StyleImage* cachedOrPendingImageSet(float);
52 53
53 String customCSSText() const; 54 String customCSSText() const;
54 55
55 bool isPending() const { return !m_accessedBestFitImage; } 56 bool isPending() const { return !m_accessedBestFitImage; }
56 57
57 struct ImageWithScale { 58 struct ImageWithScale {
58 String imageURL; 59 String imageURL;
60 Referrer referrer;
59 float scaleFactor; 61 float scaleFactor;
60 }; 62 };
61 63
62 bool hasFailedOrCanceledSubresources() const; 64 bool hasFailedOrCanceledSubresources() const;
63 65
64 PassRefPtrWillBeRawPtr<CSSImageSetValue> cloneForCSSOM() const; 66 PassRefPtrWillBeRawPtr<CSSImageSetValue> cloneForCSSOM() const;
65 67
66 void traceAfterDispatch(Visitor* visitor) { CSSValueList::traceAfterDispatch (visitor); } 68 void traceAfterDispatch(Visitor* visitor) { CSSValueList::traceAfterDispatch (visitor); }
67 69
68 protected: 70 protected:
(...skipping 14 matching lines...) Expand all
83 float m_scaleFactor; 85 float m_scaleFactor;
84 86
85 Vector<ImageWithScale> m_imagesInSet; 87 Vector<ImageWithScale> m_imagesInSet;
86 }; 88 };
87 89
88 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue()); 90 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue());
89 91
90 } // namespace WebCore 92 } // namespace WebCore
91 93
92 #endif // CSSImageSetValue_h 94 #endif // CSSImageSetValue_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontFaceSrcValue.cpp ('k') | Source/core/css/CSSImageSetValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698