OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> | 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> |
4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007 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 26 matching lines...) Expand all Loading... |
37 class ImageResourceClient; | 37 class ImageResourceClient; |
38 class FetchRequest; | 38 class FetchRequest; |
39 class ResourceFetcher; | 39 class ResourceFetcher; |
40 class FloatSize; | 40 class FloatSize; |
41 class Length; | 41 class Length; |
42 class MemoryCache; | 42 class MemoryCache; |
43 class SecurityOrigin; | 43 class SecurityOrigin; |
44 | 44 |
45 class CORE_EXPORT ImageResource final : public Resource, public ImageObserver { | 45 class CORE_EXPORT ImageResource final : public Resource, public ImageObserver { |
46 friend class MemoryCache; | 46 friend class MemoryCache; |
47 | 47 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageResource); |
48 public: | 48 public: |
49 using ClientType = ImageResourceClient; | 49 using ClientType = ImageResourceClient; |
50 | 50 |
51 static PassRefPtrWillBeRawPtr<ImageResource> fetch(FetchRequest&, ResourceFe
tcher*); | 51 static PassRefPtrWillBeRawPtr<ImageResource> fetch(FetchRequest&, ResourceFe
tcher*); |
52 | 52 |
53 static PassRefPtrWillBeRawPtr<ImageResource> create(blink::Image* image) | 53 static PassRefPtrWillBeRawPtr<ImageResource> create(blink::Image* image) |
54 { | 54 { |
55 return adoptRefWillBeNoop(new ImageResource(image)); | 55 return adoptRefWillBeNoop(new ImageResource(image)); |
56 } | 56 } |
57 | 57 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 bool stillNeedsLoad() const override { return !errorOccurred() && status() =
= Unknown && !isLoading(); } | 114 bool stillNeedsLoad() const override { return !errorOccurred() && status() =
= Unknown && !isLoading(); } |
115 | 115 |
116 // ImageObserver | 116 // ImageObserver |
117 void decodedSizeChanged(const blink::Image*, int delta) override; | 117 void decodedSizeChanged(const blink::Image*, int delta) override; |
118 void didDraw(const blink::Image*) override; | 118 void didDraw(const blink::Image*) override; |
119 | 119 |
120 bool shouldPauseAnimation(const blink::Image*) override; | 120 bool shouldPauseAnimation(const blink::Image*) override; |
121 void animationAdvanced(const blink::Image*) override; | 121 void animationAdvanced(const blink::Image*) override; |
122 void changedInRect(const blink::Image*, const IntRect&) override; | 122 void changedInRect(const blink::Image*, const IntRect&) override; |
123 | 123 |
| 124 DECLARE_VIRTUAL_TRACE(); |
| 125 |
124 protected: | 126 protected: |
125 bool isSafeToUnlock() const override; | 127 bool isSafeToUnlock() const override; |
126 void destroyDecodedDataIfPossible() override; | 128 void destroyDecodedDataIfPossible() override; |
127 void destroyDecodedDataForFailedRevalidation() override; | 129 void destroyDecodedDataForFailedRevalidation() override; |
128 | 130 |
129 private: | 131 private: |
130 explicit ImageResource(blink::Image*); | 132 explicit ImageResource(blink::Image*); |
131 ImageResource(const ResourceRequest&, blink::Image*); | 133 ImageResource(const ResourceRequest&, blink::Image*); |
132 | 134 |
133 friend class PaintLayerTest; | 135 friend class PaintLayerTest; |
(...skipping 24 matching lines...) Expand all Loading... |
158 | 160 |
159 RefPtr<blink::Image> m_image; | 161 RefPtr<blink::Image> m_image; |
160 bool m_hasDevicePixelRatioHeaderValue; | 162 bool m_hasDevicePixelRatioHeaderValue; |
161 }; | 163 }; |
162 | 164 |
163 DEFINE_RESOURCE_TYPE_CASTS(Image); | 165 DEFINE_RESOURCE_TYPE_CASTS(Image); |
164 | 166 |
165 } // namespace blink | 167 } // namespace blink |
166 | 168 |
167 #endif | 169 #endif |
OLD | NEW |