| Index: Source/core/style/StyleImage.h
|
| diff --git a/Source/core/style/StyleImage.h b/Source/core/style/StyleImage.h
|
| index 5457c38eb03bc13dc9c2e3d76d0fcd72e56676e1..771f380cbddd2a0b9e331f8f0a1afe727ff44e7a 100644
|
| --- a/Source/core/style/StyleImage.h
|
| +++ b/Source/core/style/StyleImage.h
|
| @@ -26,6 +26,7 @@
|
|
|
| #include "core/CoreExport.h"
|
| #include "core/css/CSSValue.h"
|
| +#include "core/fetch/ImageResource.h"
|
| #include "platform/geometry/IntSize.h"
|
| #include "platform/geometry/LayoutSize.h"
|
| #include "platform/graphics/Image.h"
|
| @@ -35,7 +36,6 @@
|
|
|
| namespace blink {
|
|
|
| -class ImageResource;
|
| class CSSValue;
|
| class LayoutObject;
|
|
|
| @@ -43,7 +43,7 @@ typedef void* WrappedImagePtr;
|
|
|
| class CORE_EXPORT StyleImage : public RefCountedWillBeGarbageCollectedFinalized<StyleImage> {
|
| public:
|
| - virtual ~StyleImage() { }
|
| + virtual ~StyleImage() { printf("%p: StyleImage freed\n", this); }
|
|
|
| bool operator==(const StyleImage& other) const
|
| {
|
| @@ -90,6 +90,22 @@ protected:
|
| bool m_isImageResourceSet:1;
|
| };
|
|
|
| +class CSSStyleImageMap {
|
| +public:
|
| + typedef WillBeHeapHashMap<CSSValue*, RefPtrWillBeRawPtr<StyleImage>> StyleImageMap;
|
| + typedef WillBeHeapHashMap<CSSValue*, ResourcePtr<ImageResource>> ImageResourceMap;
|
| + typedef WillBeHeapHashMap<CSSValue*, RefPtr<Image>> ImageMap;
|
| +
|
| + StyleImageMap::AddResult getStyleImageEntry(CSSValue* value) { return m_styleImages.add(value, nullptr); }
|
| + ImageResourceMap::AddResult getImageResourceEntry(CSSValue* value) { return m_imageResources.add(value, nullptr); }
|
| + ImageMap::AddResult getImageEntry(CSSValue* value) { return m_images.add(value, nullptr); }
|
| +
|
| +private:
|
| + StyleImageMap m_styleImages;
|
| + ImageResourceMap m_imageResources;
|
| + ImageMap m_images;
|
| +};
|
| +
|
| #define DEFINE_STYLE_IMAGE_TYPE_CASTS(thisType, function) \
|
| DEFINE_TYPE_CASTS(thisType, StyleImage, styleImage, styleImage->function, styleImage.function); \
|
| inline thisType* to##thisType(const RefPtrWillBeMember<StyleImage>& styleImage) { return to##thisType(styleImage.get()); } \
|
|
|