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

Unified Diff: Source/core/css/CSSImageValue.h

Issue 1308953009: Move Image ownership out of CSSValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSImageGeneratorValue.cpp ('k') | Source/core/css/CSSImageValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSImageValue.h
diff --git a/Source/core/css/CSSImageValue.h b/Source/core/css/CSSImageValue.h
index 9019164dc9faad43d516699fbb17060e31a8ad31..48111f223a69e6b7361355c13a0ba5dda7dd8949 100644
--- a/Source/core/css/CSSImageValue.h
+++ b/Source/core/css/CSSImageValue.h
@@ -22,6 +22,7 @@
#define CSSImageValue_h
#include "core/css/CSSValue.h"
+#include "core/style/StyleImage.h"
#include "core/fetch/ResourceFetcher.h"
#include "platform/weborigin/Referrer.h"
#include "wtf/RefPtr.h"
@@ -36,27 +37,33 @@ class LayoutObject;
class CSSImageValue : public CSSValue {
public:
+ static PassRefPtrWillBeRawPtr<CSSImageValue> create(const String& relativeUrl, const String& absoluteUrl, StyleImage* image = 0)
+ {
+ return adoptRefWillBeNoop(new CSSImageValue(relativeUrl, absoluteUrl, image));
+ }
static PassRefPtrWillBeRawPtr<CSSImageValue> create(const KURL& url, StyleImage* image = 0)
{
- return adoptRefWillBeNoop(new CSSImageValue(url, url, image));
+ return adoptRefWillBeNoop(new CSSImageValue(url.string(), url.string(), image));
}
static PassRefPtrWillBeRawPtr<CSSImageValue> create(const String& rawValue, const KURL& url, StyleImage* image = 0)
{
- return adoptRefWillBeNoop(new CSSImageValue(rawValue, url, image));
+ return adoptRefWillBeNoop(new CSSImageValue(rawValue, url.string(), image));
}
~CSSImageValue();
- StyleFetchedImage* cachedImage(Document*, const ResourceLoaderOptions&);
- StyleFetchedImage* cachedImage(Document* document) { return cachedImage(document, ResourceFetcher::defaultResourceOptions()); }
+ StyleFetchedImage* cachedImage(Document*, const ResourceLoaderOptions&, CSSStyleImageMap&);
+ StyleFetchedImage* cachedImage(Document* document, CSSStyleImageMap& imageMap) { return cachedImage(document, ResourceFetcher::defaultResourceOptions(), imageMap); }
// Returns a StyleFetchedImage if the image is cached already, otherwise a StylePendingImage.
StyleImage* cachedOrPendingImage();
+ StyleImage* cachedOrPendingImage(CSSStyleImageMap&);
- const String& url() { return m_absoluteURL; }
+ const String& relativeUrl() const { return m_relativeURL; }
+ const String& url() const { return m_absoluteURL; }
void setReferrer(const Referrer& referrer) { m_referrer = referrer; }
const Referrer& referrer() const { return m_referrer; }
- void reResolveURL(const Document&);
+ //void reResolveURL(const Document&);
String customCSSText() const;
@@ -69,10 +76,10 @@ public:
void setInitiator(const AtomicString& name) { m_initiatorName = name; }
DECLARE_TRACE_AFTER_DISPATCH();
- void restoreCachedResourceIfNeeded(Document&);
+ void restoreCachedResourceIfNeeded(Document&, CSSStyleImageMap&);
private:
- CSSImageValue(const String& rawValue, const KURL&, StyleImage*);
+ CSSImageValue(const String& rawValue, const String& url, StyleImage*);
String m_relativeURL;
String m_absoluteURL;
« no previous file with comments | « Source/core/css/CSSImageGeneratorValue.cpp ('k') | Source/core/css/CSSImageValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698