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) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 bool ImageResource::CanReuse(const FetchParameters& params) const { | 175 bool ImageResource::CanReuse(const FetchParameters& params) const { |
176 // If the image is a placeholder, but this fetch doesn't allow a | 176 // If the image is a placeholder, but this fetch doesn't allow a |
177 // placeholder, then do not reuse this resource. | 177 // placeholder, then do not reuse this resource. |
178 if (params.GetPlaceholderImageRequestType() != | 178 if (params.GetPlaceholderImageRequestType() != |
179 FetchParameters::kAllowPlaceholder && | 179 FetchParameters::kAllowPlaceholder && |
180 placeholder_option_ != PlaceholderOption::kDoNotReloadPlaceholder) | 180 placeholder_option_ != PlaceholderOption::kDoNotReloadPlaceholder) |
181 return false; | 181 return false; |
182 return true; | 182 return true; |
183 } | 183 } |
184 | 184 |
| 185 bool ImageResource::CanUseCacheValidator() const { |
| 186 // Disable revalidation while ImageResourceContent is still waiting for |
| 187 // SVG load completion. |
| 188 // TODO(hiroshige): Clean up revalidation-related dependencies. |
| 189 if (!GetContent()->IsLoaded()) |
| 190 return false; |
| 191 |
| 192 return Resource::CanUseCacheValidator(); |
| 193 } |
| 194 |
185 ImageResource* ImageResource::Create(const ResourceRequest& request) { | 195 ImageResource* ImageResource::Create(const ResourceRequest& request) { |
186 return new ImageResource(request, ResourceLoaderOptions(), | 196 return new ImageResource(request, ResourceLoaderOptions(), |
187 ImageResourceContent::CreateNotStarted(), false); | 197 ImageResourceContent::CreateNotStarted(), false); |
188 } | 198 } |
189 | 199 |
190 ImageResource::ImageResource(const ResourceRequest& resource_request, | 200 ImageResource::ImageResource(const ResourceRequest& resource_request, |
191 const ResourceLoaderOptions& options, | 201 const ResourceLoaderOptions& options, |
192 ImageResourceContent* content, | 202 ImageResourceContent* content, |
193 bool is_placeholder) | 203 bool is_placeholder) |
194 : Resource(resource_request, kImage, options), | 204 : Resource(resource_request, kImage, options), |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 // reloading in Step 3 due to notifyObservers()'s | 623 // reloading in Step 3 due to notifyObservers()'s |
614 // schedulingReloadOrShouldReloadBrokenPlaceholder() check. | 624 // schedulingReloadOrShouldReloadBrokenPlaceholder() check. |
615 // 3. reloadIfLoFiOrPlaceholderImage() is called via ResourceFetcher | 625 // 3. reloadIfLoFiOrPlaceholderImage() is called via ResourceFetcher |
616 // (a) via didFinishLoading() called in decodeError(), or | 626 // (a) via didFinishLoading() called in decodeError(), or |
617 // (b) after returning ImageResource::updateImage(). | 627 // (b) after returning ImageResource::updateImage(). |
618 DecodeError(all_data_received); | 628 DecodeError(all_data_received); |
619 } | 629 } |
620 } | 630 } |
621 | 631 |
622 } // namespace blink | 632 } // namespace blink |
OLD | NEW |