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 ResourcePtr<ImageResource> fetch(FetchRequest&, ResourceFetcher*); | 51 static ResourcePtr<ImageResource> fetch(FetchRequest&, ResourceFetcher*); |
52 | 52 |
53 ImageResource(blink::Image*); | 53 ImageResource(blink::Image*); |
54 // Exposed for testing | 54 // Exposed for testing |
55 ImageResource(const ResourceRequest&, blink::Image*); | 55 ImageResource(const ResourceRequest&, blink::Image*); |
56 ~ImageResource() override; | 56 ~ImageResource() override; |
57 | 57 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool stillNeedsLoad() const override { return !errorOccurred() && status() =
= Unknown && !isLoading(); } | 102 bool stillNeedsLoad() const override { return !errorOccurred() && status() =
= Unknown && !isLoading(); } |
103 | 103 |
104 // ImageObserver | 104 // ImageObserver |
105 void decodedSizeChanged(const blink::Image*, int delta) override; | 105 void decodedSizeChanged(const blink::Image*, int delta) override; |
106 void didDraw(const blink::Image*) override; | 106 void didDraw(const blink::Image*) override; |
107 | 107 |
108 bool shouldPauseAnimation(const blink::Image*) override; | 108 bool shouldPauseAnimation(const blink::Image*) override; |
109 void animationAdvanced(const blink::Image*) override; | 109 void animationAdvanced(const blink::Image*) override; |
110 void changedInRect(const blink::Image*, const IntRect&) override; | 110 void changedInRect(const blink::Image*, const IntRect&) override; |
111 | 111 |
| 112 DECLARE_VIRTUAL_TRACE(); |
| 113 |
112 protected: | 114 protected: |
113 bool isSafeToUnlock() const override; | 115 bool isSafeToUnlock() const override; |
114 void destroyDecodedDataIfPossible() override; | 116 void destroyDecodedDataIfPossible() override; |
115 void destroyDecodedDataForFailedRevalidation() override; | 117 void destroyDecodedDataForFailedRevalidation() override; |
116 | 118 |
117 private: | 119 private: |
118 class ImageResourceFactory : public ResourceFactory { | 120 class ImageResourceFactory : public ResourceFactory { |
119 public: | 121 public: |
120 ImageResourceFactory() | 122 ImageResourceFactory() |
121 : ResourceFactory(Resource::Image) { } | 123 : ResourceFactory(Resource::Image) { } |
(...skipping 19 matching lines...) Expand all Loading... |
141 | 143 |
142 RefPtr<blink::Image> m_image; | 144 RefPtr<blink::Image> m_image; |
143 bool m_hasDevicePixelRatioHeaderValue; | 145 bool m_hasDevicePixelRatioHeaderValue; |
144 }; | 146 }; |
145 | 147 |
146 DEFINE_RESOURCE_TYPE_CASTS(Image); | 148 DEFINE_RESOURCE_TYPE_CASTS(Image); |
147 | 149 |
148 } | 150 } |
149 | 151 |
150 #endif | 152 #endif |
OLD | NEW |