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

Unified Diff: Source/core/loader/FrameFetchContext.cpp

Issue 1309533002: Merge a couple of memory cache hit notifications (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/core/loader/FrameFetchContext.cpp
diff --git a/Source/core/loader/FrameFetchContext.cpp b/Source/core/loader/FrameFetchContext.cpp
index c0771e70b85666694be354ca9f2b1dec1e7cef9a..d4e6d11d8b8e48c90d0a48a4588485181cc80aac 100644
--- a/Source/core/loader/FrameFetchContext.cpp
+++ b/Source/core/loader/FrameFetchContext.cpp
@@ -34,6 +34,7 @@
#include "bindings/core/v8/ScriptController.h"
#include "core/dom/Document.h"
#include "core/fetch/ClientHintsPreferences.h"
+#include "core/fetch/UniqueIdentifier.h"
#include "core/frame/FrameConsole.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
@@ -221,11 +222,6 @@ void FrameFetchContext::dispatchWillSendRequest(unsigned long identifier, Resour
InspectorInstrumentation::willSendRequest(frame(), identifier, ensureLoaderForNotifications(), request, redirectResponse, initiatorInfo);
}
-void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(const ResourceRequest& request, const ResourceResponse& response)
-{
- frame()->loader().client()->dispatchDidLoadResourceFromMemoryCache(request, response);
-}
-
void FrameFetchContext::dispatchDidReceiveResponse(unsigned long identifier, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddress());
@@ -280,14 +276,20 @@ void FrameFetchContext::dispatchDidFail(unsigned long identifier, const Resource
frame()->console().didFailLoading(identifier, error);
}
-void FrameFetchContext::sendRemainingDelegateMessages(unsigned long identifier, const ResourceResponse& response, int dataLength)
+
+void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(const Resource* resource)
{
+ ResourceRequest request(resource->url());
+ unsigned long identifier = createUniqueIdentifier();
+ frame()->loader().client()->dispatchDidLoadResourceFromMemoryCache(request, resource->response());
+ dispatchWillSendRequest(identifier, request, ResourceResponse(), resource->options().initiatorInfo);
+
InspectorInstrumentation::markResourceAsCached(frame(), identifier);
- if (!response.isNull())
- dispatchDidReceiveResponse(identifier, response);
+ if (!resource->response().isNull())
+ dispatchDidReceiveResponse(identifier, resource->response());
- if (dataLength > 0)
- dispatchDidReceiveData(identifier, 0, dataLength, 0);
+ if (resource->encodedSize() > 0)
+ dispatchDidReceiveData(identifier, 0, resource->encodedSize(), 0);
dispatchDidFinishLoading(identifier, 0, 0);
}
« Source/core/fetch/ResourceFetcher.cpp ('K') | « Source/core/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698