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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void onePartInMultipartReceived(const ResourceResponse&) final; | 153 void onePartInMultipartReceived(const ResourceResponse&) final; |
154 void multipartDataReceived(const char*, size_t) final; | 154 void multipartDataReceived(const char*, size_t) final; |
155 | 155 |
156 // Used by tests. | 156 // Used by tests. |
157 bool isPlaceholder() const { return m_isPlaceholder; } | 157 bool isPlaceholder() const { return m_isPlaceholder; } |
158 | 158 |
159 bool shouldReloadBrokenPlaceholder() const { | 159 bool shouldReloadBrokenPlaceholder() const { |
160 return m_isPlaceholder && willPaintBrokenImage(); | 160 return m_isPlaceholder && willPaintBrokenImage(); |
161 } | 161 } |
162 | 162 |
| 163 void setNotRefetchableDataFromDiskCache() { |
| 164 m_isRefetchableDataFromDiskCache = false; |
| 165 } |
| 166 |
163 DECLARE_VIRTUAL_TRACE(); | 167 DECLARE_VIRTUAL_TRACE(); |
164 | 168 |
165 private: | 169 private: |
166 explicit ImageResource(blink::Image*, const ResourceLoaderOptions&); | 170 explicit ImageResource(blink::Image*, const ResourceLoaderOptions&); |
167 | 171 |
168 enum class MultipartParsingState : uint8_t { | 172 enum class MultipartParsingState : uint8_t { |
169 WaitingForFirstPart, | 173 WaitingForFirstPart, |
170 ParsingFirstPart, | 174 ParsingFirstPart, |
171 FinishedParsingFirstPart, | 175 FinishedParsingFirstPart, |
172 }; | 176 }; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 // because reloadIfLoFi() was called. | 221 // because reloadIfLoFi() was called. |
218 bool m_isSchedulingReload; | 222 bool m_isSchedulingReload; |
219 | 223 |
220 // Indicates if this ImageResource is either attempting to load a placeholder | 224 // Indicates if this ImageResource is either attempting to load a placeholder |
221 // image, or is a (possibly broken) placeholder image. | 225 // image, or is a (possibly broken) placeholder image. |
222 bool m_isPlaceholder; | 226 bool m_isPlaceholder; |
223 | 227 |
224 Timer<ImageResource> m_flushTimer; | 228 Timer<ImageResource> m_flushTimer; |
225 double m_lastFlushTime = 0.; | 229 double m_lastFlushTime = 0.; |
226 Image::SizeAvailability m_sizeAvailable = Image::SizeUnavailable; | 230 Image::SizeAvailability m_sizeAvailable = Image::SizeUnavailable; |
| 231 |
| 232 // Indicates if this resource's encoded image data can be purged and refetched |
| 233 // from disk cache to save memory usage. See crbug/664437. |
| 234 bool m_isRefetchableDataFromDiskCache; |
227 }; | 235 }; |
228 | 236 |
229 DEFINE_RESOURCE_TYPE_CASTS(Image); | 237 DEFINE_RESOURCE_TYPE_CASTS(Image); |
230 | 238 |
231 } // namespace blink | 239 } // namespace blink |
232 | 240 |
233 #endif | 241 #endif |
OLD | NEW |