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

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

Issue 1309533002: Merge a couple of memory cache hit notifications (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 4 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 | « Source/core/fetch/ResourceFetcher.h ('k') | Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 88aecccbca3350ccb443c3ce93c2289520fb7320..c4e60ef6cb0287542634fca608518185c3e21a0c 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -256,8 +256,8 @@ static const int kMaxValidatedURLsSize = 10000;
void ResourceFetcher::requestLoadStarted(Resource* resource, const FetchRequest& request, ResourceLoadStartType type, bool isStaticData)
{
- if (type == ResourceLoadingFromCache)
- notifyLoadedFromMemoryCache(resource);
+ if (type == ResourceLoadingFromCache && resource->status() == Resource::Cached && !m_validatedURLs.contains(resource->url()))
+ context().dispatchDidLoadResourceFromMemoryCache(resource);
if (isStaticData)
return;
@@ -790,19 +790,6 @@ void ResourceFetcher::garbageCollectDocumentResources()
m_documentResources.removeAll(resourcesToDelete);
}
-void ResourceFetcher::notifyLoadedFromMemoryCache(Resource* resource)
-{
- if (resource->status() != Resource::Cached || m_validatedURLs.contains(resource->url()))
- return;
-
- ResourceRequest request(resource->url());
- unsigned long identifier = createUniqueIdentifier();
- context().dispatchDidLoadResourceFromMemoryCache(request, resource->response());
- // FIXME: If willSendRequest changes the request, we don't respect it.
- willSendRequest(identifier, request, ResourceResponse(), resource->options().initiatorInfo);
- context().sendRemainingDelegateMessages(identifier, resource->response(), resource->encodedSize());
-}
-
int ResourceFetcher::requestCount() const
{
return m_loaders ? m_loaders->size() : 0;
« no previous file with comments | « Source/core/fetch/ResourceFetcher.h ('k') | Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698