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

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: 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/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameFetchContext.cpp
diff --git a/Source/core/loader/FrameFetchContext.cpp b/Source/core/loader/FrameFetchContext.cpp
index f2460a7979e44966c0f039a5ad3b1e4cdcd2a656..c6dd2ae45a9409d4243cbb5cba14d695b5aa802a 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);
}
« no previous file with comments | « Source/core/loader/FrameFetchContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698