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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp

Issue 2527353002: Phase II Step 3: Reload LoFi/placeholder images via new ImageResource
Patch Set: Use startLoad() again to avoid re-applying modifications to ResourceRequest on reload Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index a5eae6c5bf861db7dc1fd4028a4489e01506f60b..2373a11a21861dab9b7f323a35d062b6f262a7cc 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -513,6 +513,11 @@ ResourceFetcher::PrepareRequestResult ResourceFetcher::prepareRequest(
return Continue;
}
+void ResourceFetcher::addToDocumentResources(Resource* resource) {
+ m_documentResources.set(
+ MemoryCache::removeFragmentIdentifierIfNeeded(resource->url()), resource);
+}
+
Resource* ResourceFetcher::requestResource(
FetchRequest& request,
const ResourceFactory& factory,
@@ -612,8 +617,7 @@ Resource* ResourceFetcher::requestResource(
identifier, resource, request,
policy == Use ? ResourceLoadingFromCache : ResourceLoadingFromNetwork,
isStaticData);
- m_documentResources.set(
- MemoryCache::removeFragmentIdentifierIfNeeded(request.url()), resource);
+ addToDocumentResources(resource);
// Returns with an existing resource if the resource does not need to start
// loading immediately. If revalidation policy was determined as |Revalidate|,
@@ -1332,7 +1336,7 @@ void ResourceFetcher::updateAllImageResourcePriorities() {
}
void ResourceFetcher::reloadLoFiImages() {
- for (const auto& documentResource : m_documentResources) {
+ for (auto& documentResource : m_documentResources) {
yhirano 2017/03/17 13:09:35 What is the intention of this change?
Resource* resource = documentResource.value.get();
if (resource)
resource->reloadIfLoFiOrPlaceholderImage(this, Resource::kReloadAlways);
kouhei (in TOK) 2017/03/15 10:25:28 or should we replace m_documentResources using the
hiroshige 2017/03/15 19:03:31 In fact I am sure that we update |m_documentResour

Powered by Google App Engine
This is Rietveld 408576698