Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(844)

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/ImageResource.cpp

Issue 2613853002: Phase III Step 2: Call imageNotifyFinished() and image load event after SVG loading completes (Closed)
Patch Set: Forbid revalidation during waiting for SVG load completion. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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())
hiroshige 2017/05/04 22:50:50 This is not clean, but ImageResourceContent has al
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698