OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 #ifndef CSSImageValue_h | 21 #ifndef CSSImageValue_h |
22 #define CSSImageValue_h | 22 #define CSSImageValue_h |
23 | 23 |
24 #include "core/css/CSSValue.h" | 24 #include "core/css/CSSValue.h" |
25 #include "core/fetch/ResourceFetcher.h" | 25 #include "core/fetch/ResourceFetcher.h" |
| 26 #include "platform/weborigin/Referrer.h" |
26 #include "wtf/RefPtr.h" | 27 #include "wtf/RefPtr.h" |
27 | 28 |
28 namespace WebCore { | 29 namespace WebCore { |
29 | 30 |
30 class Document; | 31 class Document; |
31 class Element; | 32 class Element; |
32 class KURL; | 33 class KURL; |
33 class StyleFetchedImage; | 34 class StyleFetchedImage; |
34 class StyleImage; | 35 class StyleImage; |
35 class RenderObject; | 36 class RenderObject; |
(...skipping 10 matching lines...) Expand all Loading... |
46 } | 47 } |
47 ~CSSImageValue(); | 48 ~CSSImageValue(); |
48 | 49 |
49 StyleFetchedImage* cachedImage(ResourceFetcher*, const ResourceLoaderOptions
&); | 50 StyleFetchedImage* cachedImage(ResourceFetcher*, const ResourceLoaderOptions
&); |
50 StyleFetchedImage* cachedImage(ResourceFetcher* fetcher) { return cachedImag
e(fetcher, ResourceFetcher::defaultResourceOptions()); } | 51 StyleFetchedImage* cachedImage(ResourceFetcher* fetcher) { return cachedImag
e(fetcher, ResourceFetcher::defaultResourceOptions()); } |
51 // Returns a StyleFetchedImage if the image is cached already, otherwise a S
tylePendingImage. | 52 // Returns a StyleFetchedImage if the image is cached already, otherwise a S
tylePendingImage. |
52 StyleImage* cachedOrPendingImage(); | 53 StyleImage* cachedOrPendingImage(); |
53 | 54 |
54 const String& url() { return m_absoluteURL; } | 55 const String& url() { return m_absoluteURL; } |
55 | 56 |
| 57 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } |
| 58 const Referrer& referrer() const { return m_referrer; } |
| 59 |
56 void reResolveURL(const Document&); | 60 void reResolveURL(const Document&); |
57 | 61 |
58 String customCSSText() const; | 62 String customCSSText() const; |
59 | 63 |
60 PassRefPtrWillBeRawPtr<CSSValue> cloneForCSSOM() const; | 64 PassRefPtrWillBeRawPtr<CSSValue> cloneForCSSOM() const; |
61 | 65 |
62 bool hasFailedOrCanceledSubresources() const; | 66 bool hasFailedOrCanceledSubresources() const; |
63 | 67 |
64 bool equals(const CSSImageValue&) const; | 68 bool equals(const CSSImageValue&) const; |
65 | 69 |
66 bool knownToBeOpaque(const RenderObject*) const; | 70 bool knownToBeOpaque(const RenderObject*) const; |
67 | 71 |
68 void setInitiator(const AtomicString& name) { m_initiatorName = name; } | 72 void setInitiator(const AtomicString& name) { m_initiatorName = name; } |
69 | 73 |
70 void traceAfterDispatch(Visitor*); | 74 void traceAfterDispatch(Visitor*); |
71 void restoreCachedResourceIfNeeded(Document&); | 75 void restoreCachedResourceIfNeeded(Document&); |
72 | 76 |
73 private: | 77 private: |
74 CSSImageValue(const String& rawValue, const KURL&, StyleImage*); | 78 CSSImageValue(const String& rawValue, const KURL&, StyleImage*); |
75 | 79 |
76 String m_relativeURL; | 80 String m_relativeURL; |
77 String m_absoluteURL; | 81 String m_absoluteURL; |
| 82 Referrer m_referrer; |
78 RefPtr<StyleImage> m_image; | 83 RefPtr<StyleImage> m_image; |
79 bool m_accessedImage; | 84 bool m_accessedImage; |
80 AtomicString m_initiatorName; | 85 AtomicString m_initiatorName; |
81 }; | 86 }; |
82 | 87 |
83 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageValue, isImageValue()); | 88 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageValue, isImageValue()); |
84 | 89 |
85 } // namespace WebCore | 90 } // namespace WebCore |
86 | 91 |
87 #endif // CSSImageValue_h | 92 #endif // CSSImageValue_h |
OLD | NEW |