OLD | NEW |
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 11 matching lines...) Expand all Loading... |
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/ResourceLoaderOptions.h" | 30 #include "core/fetch/ResourceLoaderOptions.h" |
31 #include "platform/weborigin/Referrer.h" | 31 #include "platform/weborigin/Referrer.h" |
| 32 #include "wtf/Allocator.h" |
32 | 33 |
33 namespace blink { | 34 namespace blink { |
34 | 35 |
35 class Document; | 36 class Document; |
36 class StyleFetchedImageSet; | 37 class StyleFetchedImageSet; |
37 class StyleImage; | 38 class StyleImage; |
38 | 39 |
39 class CSSImageSetValue : public CSSValueList { | 40 class CSSImageSetValue : public CSSValueList { |
40 public: | 41 public: |
41 | 42 |
42 static PassRefPtrWillBeRawPtr<CSSImageSetValue> create() | 43 static PassRefPtrWillBeRawPtr<CSSImageSetValue> create() |
43 { | 44 { |
44 return adoptRefWillBeNoop(new CSSImageSetValue()); | 45 return adoptRefWillBeNoop(new CSSImageSetValue()); |
45 } | 46 } |
46 ~CSSImageSetValue(); | 47 ~CSSImageSetValue(); |
47 | 48 |
48 StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor, con
st ResourceLoaderOptions&); | 49 StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor, con
st ResourceLoaderOptions&); |
49 StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor); | 50 StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor); |
50 | 51 |
51 // Returns a StyleFetchedImageSet if the best fit image has been cached alre
ady, otherwise a StylePendingImage. | 52 // Returns a StyleFetchedImageSet if the best fit image has been cached alre
ady, otherwise a StylePendingImage. |
52 StyleImage* cachedOrPendingImageSet(float); | 53 StyleImage* cachedOrPendingImageSet(float); |
53 | 54 |
54 String customCSSText() const; | 55 String customCSSText() const; |
55 | 56 |
56 bool isPending() const { return !m_accessedBestFitImage; } | 57 bool isPending() const { return !m_accessedBestFitImage; } |
57 | 58 |
58 struct ImageWithScale { | 59 struct ImageWithScale { |
| 60 ALLOW_ONLY_INLINE_ALLOCATION(); |
59 String imageURL; | 61 String imageURL; |
60 Referrer referrer; | 62 Referrer referrer; |
61 float scaleFactor; | 63 float scaleFactor; |
62 }; | 64 }; |
63 | 65 |
64 bool hasFailedOrCanceledSubresources() const; | 66 bool hasFailedOrCanceledSubresources() const; |
65 | 67 |
66 DECLARE_TRACE_AFTER_DISPATCH(); | 68 DECLARE_TRACE_AFTER_DISPATCH(); |
67 | 69 |
68 protected: | 70 protected: |
(...skipping 13 matching lines...) Expand all Loading... |
82 float m_scaleFactor; | 84 float m_scaleFactor; |
83 | 85 |
84 Vector<ImageWithScale> m_imagesInSet; | 86 Vector<ImageWithScale> m_imagesInSet; |
85 }; | 87 }; |
86 | 88 |
87 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue()); | 89 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue()); |
88 | 90 |
89 } // namespace blink | 91 } // namespace blink |
90 | 92 |
91 #endif // CSSImageSetValue_h | 93 #endif // CSSImageSetValue_h |
OLD | NEW |