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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 bool shouldPauseAnimation(const blink::Image*) override; | 118 bool shouldPauseAnimation(const blink::Image*) override; |
119 void animationAdvanced(const blink::Image*) override; | 119 void animationAdvanced(const blink::Image*) override; |
120 void changedInRect(const blink::Image*, const IntRect&) override; | 120 void changedInRect(const blink::Image*, const IntRect&) override; |
121 | 121 |
122 // MultipartImageResourceParser::Client | 122 // MultipartImageResourceParser::Client |
123 void onePartInMultipartReceived(const ResourceResponse&) final; | 123 void onePartInMultipartReceived(const ResourceResponse&) final; |
124 void multipartDataReceived(const char*, size_t) final; | 124 void multipartDataReceived(const char*, size_t) final; |
125 | 125 |
126 DECLARE_VIRTUAL_TRACE(); | 126 DECLARE_VIRTUAL_TRACE(); |
127 | 127 |
128 protected: | |
129 bool isSafeToUnlock() const override; | |
130 void destroyDecodedDataIfPossible() override; | |
131 void destroyDecodedDataForFailedRevalidation() override; | |
132 | |
133 private: | 128 private: |
134 explicit ImageResource(blink::Image*, const ResourceLoaderOptions&); | 129 explicit ImageResource(blink::Image*, const ResourceLoaderOptions&); |
135 | 130 |
136 enum class MultipartParsingState : uint8_t { | 131 enum class MultipartParsingState : uint8_t { |
137 WaitingForFirstPart, | 132 WaitingForFirstPart, |
138 ParsingFirstPart, | 133 ParsingFirstPart, |
139 FinishedParsingFirstPart, | 134 FinishedParsingFirstPart, |
140 }; | 135 }; |
141 | 136 |
142 class ImageResourceFactory : public ResourceFactory { | 137 class ImageResourceFactory : public ResourceFactory { |
(...skipping 17 matching lines...) Expand all Loading... |
160 // If not null, changeRect is the changed part of the image. | 155 // If not null, changeRect is the changed part of the image. |
161 void notifyObservers(const IntRect* changeRect = nullptr); | 156 void notifyObservers(const IntRect* changeRect = nullptr); |
162 | 157 |
163 void ensureImage(); | 158 void ensureImage(); |
164 | 159 |
165 void checkNotify() override; | 160 void checkNotify() override; |
166 void markClientsAndObserversFinished() override; | 161 void markClientsAndObserversFinished() override; |
167 | 162 |
168 void doResetAnimation(); | 163 void doResetAnimation(); |
169 | 164 |
| 165 bool isSafeToUnlock() const override; |
| 166 void destroyDecodedDataIfPossible() override; |
| 167 void destroyDecodedDataForFailedRevalidation() override; |
| 168 |
170 float m_devicePixelRatioHeaderValue; | 169 float m_devicePixelRatioHeaderValue; |
171 | 170 |
172 Member<MultipartImageResourceParser> m_multipartParser; | 171 Member<MultipartImageResourceParser> m_multipartParser; |
173 RefPtr<blink::Image> m_image; | 172 RefPtr<blink::Image> m_image; |
174 MultipartParsingState m_multipartParsingState = MultipartParsingState::Waiti
ngForFirstPart; | 173 MultipartParsingState m_multipartParsingState = MultipartParsingState::Waiti
ngForFirstPart; |
175 bool m_hasDevicePixelRatioHeaderValue; | 174 bool m_hasDevicePixelRatioHeaderValue; |
176 HashCountedSet<ImageResourceObserver*> m_observers; | 175 HashCountedSet<ImageResourceObserver*> m_observers; |
177 HashCountedSet<ImageResourceObserver*> m_finishedObservers; | 176 HashCountedSet<ImageResourceObserver*> m_finishedObservers; |
178 }; | 177 }; |
179 | 178 |
180 DEFINE_RESOURCE_TYPE_CASTS(Image); | 179 DEFINE_RESOURCE_TYPE_CASTS(Image); |
181 | 180 |
182 } // namespace blink | 181 } // namespace blink |
183 | 182 |
184 #endif | 183 #endif |
OLD | NEW |