Chromium Code Reviews| Index: Source/core/css/CSSImageValue.h |
| diff --git a/Source/core/css/CSSImageValue.h b/Source/core/css/CSSImageValue.h |
| index 18e57f4f26ea6bc966d17ce7052c557c395f9934..4863966c5843e324d87cf0d3a1af1b3ba4f1b611 100644 |
| --- a/Source/core/css/CSSImageValue.h |
| +++ b/Source/core/css/CSSImageValue.h |
| @@ -23,25 +23,25 @@ |
| #include "core/css/CSSValue.h" |
| #include "core/fetch/ResourceFetcher.h" |
| +#include "platform/weborigin/KURL.h" |
| #include "wtf/RefPtr.h" |
| namespace WebCore { |
| class Element; |
| -class KURL; |
| class StyleFetchedImage; |
| class StyleImage; |
| class RenderObject; |
| class CSSImageValue : public CSSValue { |
| public: |
| - static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url) |
| + static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url, StyleImage* image = 0) |
| { |
| - return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSImageValue(url)); |
| + return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSImageValue(url, url, image)); |
| } |
| - static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url, StyleImage* image) |
| + static PassRefPtrWillBeRawPtr<CSSImageValue> create(const String& rawValue, const KURL& url, StyleImage* image = 0) |
| { |
| - return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSImageValue(url, image)); |
| + return adoptRefCountedWillBeRefCountedGarbageCollected(new CSSImageValue(rawValue, url, image)); |
| } |
| ~CSSImageValue(); |
| @@ -50,7 +50,10 @@ public: |
| // Returns a StyleFetchedImage if the image is cached already, otherwise a StylePendingImage. |
| StyleImage* cachedOrPendingImage(); |
| - const String& url() { return m_url; } |
| + const String& url() { return m_absoluteURL; } |
| + |
| + template<typename URLResolver> // Avoids a dependency on Document |
|
ojan
2014/02/26 03:00:30
templates scare me. Avoiding a Document dependency
adamk
2014/02/26 17:00:20
This may be overkill, given the other dependencies
|
| + void reResolveURL(const URLResolver& resolver) { reResolveURLInternal(resolver.completeURL(m_relativeURL)); } |
| String customCSSText() const; |
| @@ -67,10 +70,12 @@ public: |
| void traceAfterDispatch(Visitor*); |
| private: |
| - explicit CSSImageValue(const KURL&); |
| - CSSImageValue(const KURL&, StyleImage*); |
| + CSSImageValue(const String& rawValue, const KURL&, StyleImage*); |
| + |
| + void reResolveURLInternal(const KURL&); |
| - String m_url; |
| + String m_relativeURL; |
| + String m_absoluteURL; |
| RefPtr<StyleImage> m_image; |
| bool m_accessedImage; |
| AtomicString m_initiatorName; |