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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 2319483002: Turn off isLinkPreload() when used (Closed)
Patch Set: remove changes in Resource Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 5ff0d0d3861a31c60532f733a76016d704734229..903e5f2795cc70aa5356dcbe64f12c578f1a557a 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -474,6 +474,8 @@ Resource* ResourceFetcher::requestResource(FetchRequest& request, const Resource
initializeRevalidation(request.mutableResourceRequest(), resource);
break;
case Use:
+ if (resource->isLinkPreload() && !request.isLinkPreload())
+ resource->setLinkPreload(false);
memoryCache()->updateForAccess(resource);
break;
}
@@ -868,11 +870,11 @@ void ResourceFetcher::preloadStarted(Resource* resource)
if (m_preloads && m_preloads->contains(resource))
return;
TRACE_EVENT_ASYNC_STEP_INTO0("blink.net", "Resource", resource->identifier(), "Preload");
- resource->increasePreloadCount();
if (!m_preloads)
m_preloads = new HeapListHashSet<Member<Resource>>;
- m_preloads->add(resource);
+ if (m_preloads->add(resource).isNewEntry)
Nate Chapin 2016/09/12 20:44:51 Why doesn't the m_preloads->contains(resource) abo
Yoav Weiss 2016/09/12 21:01:16 You're right. It does.
+ resource->increasePreloadCount();
}
bool ResourceFetcher::isPreloaded(const KURL& url) const
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698