| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2  * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 
| 3  *           (C) 2000 Antti Koivisto (koivisto@kde.org) | 3  *           (C) 2000 Antti Koivisto (koivisto@kde.org) | 
| 4  *           (C) 2000 Dirk Mueller (mueller@kde.org) | 4  *           (C) 2000 Dirk Mueller (mueller@kde.org) | 
| 5  * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5  * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 
| 6  * | 6  * | 
| 7  * This library is free software; you can redistribute it and/or | 7  * This library is free software; you can redistribute it and/or | 
| 8  * modify it under the terms of the GNU Library General Public | 8  * modify it under the terms of the GNU Library General Public | 
| 9  * License as published by the Free Software Foundation; either | 9  * License as published by the Free Software Foundation; either | 
| 10  * version 2 of the License, or (at your option) any later version. | 10  * version 2 of the License, or (at your option) any later version. | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 28 #include "core/fetch/ResourcePtr.h" | 28 #include "core/fetch/ResourcePtr.h" | 
| 29 #include "core/style/StyleImage.h" | 29 #include "core/style/StyleImage.h" | 
| 30 | 30 | 
| 31 namespace blink { | 31 namespace blink { | 
| 32 | 32 | 
| 33 class Document; | 33 class Document; | 
| 34 class ImageResource; | 34 class ImageResource; | 
| 35 | 35 | 
| 36 class StyleFetchedImage final : public StyleImage, private ImageResourceClient { | 36 class StyleFetchedImage final : public StyleImage, private ImageResourceClient { | 
| 37     USING_FAST_MALLOC_WILL_BE_REMOVED(StyleFetchedImage); | 37     USING_FAST_MALLOC_WILL_BE_REMOVED(StyleFetchedImage); | 
|  | 38     WILL_BE_USING_PRE_FINALIZER(StyleFetchedImage, dispose); | 
| 38 public: | 39 public: | 
| 39     static PassRefPtrWillBeRawPtr<StyleFetchedImage> create(ImageResource* image
    , Document* document, const KURL& url) | 40     static PassRefPtrWillBeRawPtr<StyleFetchedImage> create(ImageResource* image
    , Document* document, const KURL& url) | 
| 40     { | 41     { | 
| 41         return adoptRefWillBeNoop(new StyleFetchedImage(image, document, url)); | 42         return adoptRefWillBeNoop(new StyleFetchedImage(image, document, url)); | 
| 42     } | 43     } | 
| 43     ~StyleFetchedImage() override; | 44     ~StyleFetchedImage() override; | 
| 44 | 45 | 
| 45     WrappedImagePtr data() const override; | 46     WrappedImagePtr data() const override; | 
| 46 | 47 | 
| 47     PassRefPtrWillBeRawPtr<CSSValue> cssValue() const override; | 48     PassRefPtrWillBeRawPtr<CSSValue> cssValue() const override; | 
| 48     PassRefPtrWillBeRawPtr<CSSValue> computedCSSValue() const override; | 49     PassRefPtrWillBeRawPtr<CSSValue> computedCSSValue() const override; | 
| 49 | 50 | 
| 50     bool canRender() const override; | 51     bool canRender() const override; | 
| 51     bool isLoaded() const override; | 52     bool isLoaded() const override; | 
| 52     bool errorOccurred() const override; | 53     bool errorOccurred() const override; | 
| 53     LayoutSize imageSize(const LayoutObject*, float multiplier) const override; | 54     LayoutSize imageSize(const LayoutObject*, float multiplier) const override; | 
| 54     bool imageHasRelativeWidth() const override; | 55     bool imageHasRelativeWidth() const override; | 
| 55     bool imageHasRelativeHeight() const override; | 56     bool imageHasRelativeHeight() const override; | 
| 56     void computeIntrinsicDimensions(const LayoutObject*, Length& intrinsicWidth,
     Length& intrinsicHeight, FloatSize& intrinsicRatio) override; | 57     void computeIntrinsicDimensions(const LayoutObject*, Length& intrinsicWidth,
     Length& intrinsicHeight, FloatSize& intrinsicRatio) override; | 
| 57     bool usesImageContainerSize() const override; | 58     bool usesImageContainerSize() const override; | 
| 58     void addClient(LayoutObject*) override; | 59     void addClient(LayoutObject*) override; | 
| 59     void removeClient(LayoutObject*) override; | 60     void removeClient(LayoutObject*) override; | 
| 60     void notifyFinished(Resource*) override; | 61     void notifyFinished(Resource*) override; | 
| 61     String debugName() const override { return "StyleFetchedImage"; } | 62     String debugName() const override { return "StyleFetchedImage"; } | 
| 62     PassRefPtr<Image> image(const LayoutObject*, const IntSize&, float zoom) con
    st override; | 63     PassRefPtr<Image> image(const LayoutObject*, const IntSize&, float zoom) con
    st override; | 
| 63     bool knownToBeOpaque(const LayoutObject*) const override; | 64     bool knownToBeOpaque(const LayoutObject*) const override; | 
| 64     ImageResource* cachedImage() const override; | 65     ImageResource* cachedImage() const override; | 
| 65 | 66 | 
| 66 #if ENABLE(OILPAN) |  | 
| 67     // Promptly remove as a ImageResource client. |  | 
| 68     EAGERLY_FINALIZE(); |  | 
| 69     DECLARE_EAGER_FINALIZATION_OPERATOR_NEW(); |  | 
| 70 #endif |  | 
| 71     DECLARE_VIRTUAL_TRACE(); | 67     DECLARE_VIRTUAL_TRACE(); | 
| 72 | 68 | 
| 73 private: | 69 private: | 
| 74     StyleFetchedImage(ImageResource*, Document*, const KURL&); | 70     StyleFetchedImage(ImageResource*, Document*, const KURL&); | 
| 75 | 71 | 
|  | 72     void dispose(); | 
|  | 73 | 
| 76     ResourcePtr<ImageResource> m_image; | 74     ResourcePtr<ImageResource> m_image; | 
| 77     RawPtrWillBeMember<Document> m_document; | 75     RawPtrWillBeMember<Document> m_document; | 
| 78     const KURL m_url; | 76     const KURL m_url; | 
| 79 }; | 77 }; | 
| 80 | 78 | 
| 81 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleFetchedImage, isImageResource()); | 79 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleFetchedImage, isImageResource()); | 
| 82 | 80 | 
| 83 } | 81 } | 
| 84 #endif | 82 #endif | 
| OLD | NEW | 
|---|