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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 bool ImageResource::CanReuse(const FetchParameters& params) const { | 174 bool ImageResource::CanReuse(const FetchParameters& params) const { |
175 // If the image is a placeholder, but this fetch doesn't allow a | 175 // If the image is a placeholder, but this fetch doesn't allow a |
176 // placeholder, then do not reuse this resource. | 176 // placeholder, then do not reuse this resource. |
177 if (params.GetPlaceholderImageRequestType() != | 177 if (params.GetPlaceholderImageRequestType() != |
178 FetchParameters::kAllowPlaceholder && | 178 FetchParameters::kAllowPlaceholder && |
179 placeholder_option_ != PlaceholderOption::kDoNotReloadPlaceholder) | 179 placeholder_option_ != PlaceholderOption::kDoNotReloadPlaceholder) |
180 return false; | 180 return false; |
181 return true; | 181 return true; |
182 } | 182 } |
183 | 183 |
| 184 bool ImageResource::CanUseCacheValidator() const { |
| 185 // Disable revalidation while ImageResourceContent is still waiting for |
| 186 // SVG load completion. |
| 187 // TODO(hiroshige): Clean up revalidation-related dependencies. |
| 188 if (!GetContent()->IsLoaded()) |
| 189 return false; |
| 190 |
| 191 return Resource::CanUseCacheValidator(); |
| 192 } |
| 193 |
184 ImageResource* ImageResource::Create(const ResourceRequest& request) { | 194 ImageResource* ImageResource::Create(const ResourceRequest& request) { |
185 return new ImageResource(request, ResourceLoaderOptions(), | 195 return new ImageResource(request, ResourceLoaderOptions(), |
186 ImageResourceContent::Create(), false); | 196 ImageResourceContent::Create(), false); |
187 } | 197 } |
188 | 198 |
189 ImageResource::ImageResource(const ResourceRequest& resource_request, | 199 ImageResource::ImageResource(const ResourceRequest& resource_request, |
190 const ResourceLoaderOptions& options, | 200 const ResourceLoaderOptions& options, |
191 ImageResourceContent* content, | 201 ImageResourceContent* content, |
192 bool is_placeholder) | 202 bool is_placeholder) |
193 : Resource(resource_request, kImage, options), | 203 : Resource(resource_request, kImage, options), |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 // reloading in Step 3 due to notifyObservers()'s | 611 // reloading in Step 3 due to notifyObservers()'s |
602 // schedulingReloadOrShouldReloadBrokenPlaceholder() check. | 612 // schedulingReloadOrShouldReloadBrokenPlaceholder() check. |
603 // 3. reloadIfLoFiOrPlaceholderImage() is called via ResourceFetcher | 613 // 3. reloadIfLoFiOrPlaceholderImage() is called via ResourceFetcher |
604 // (a) via didFinishLoading() called in decodeError(), or | 614 // (a) via didFinishLoading() called in decodeError(), or |
605 // (b) after returning ImageResource::updateImage(). | 615 // (b) after returning ImageResource::updateImage(). |
606 DecodeError(all_data_received); | 616 DecodeError(all_data_received); |
607 } | 617 } |
608 } | 618 } |
609 | 619 |
610 } // namespace blink | 620 } // namespace blink |
OLD | NEW |