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

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

Issue 2748463002: Split header modification out of willSendRequest
Patch Set: bug fix 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/core/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index b62fe6436b012a3c7e15efae9ce5961b2492a63a..68bbc93d075357020e367b4ec0b968cf40674f1d 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -421,22 +421,19 @@ void FrameFetchContext::dispatchDidChangeResourcePriority(
probe::didChangeResourcePriority(frame(), identifier, loadPriority);
}
-void FrameFetchContext::prepareRequest(ResourceRequest& request) {
+void FrameFetchContext::prepareRequest(unsigned long identifier,
+ ResourceRequest& request) {
frame()->loader().applyUserAgent(request);
localFrameClient()->dispatchWillSendRequest(request);
+ probe::prepareRequest(frame(), identifier, request);
}
void FrameFetchContext::dispatchWillSendRequest(
unsigned long identifier,
- ResourceRequest& request,
+ const ResourceRequest& request,
const ResourceResponse& redirectResponse,
const FetchInitiatorInfo& initiatorInfo) {
- // For initial requests, prepareRequest() is called in
- // willStartLoadingResource(), before revalidation policy is determined. That
- // call doesn't exist for redirects, so call preareRequest() here.
- if (!redirectResponse.isNull()) {
- prepareRequest(request);
- } else {
+ if (redirectResponse.isNull()) {
frame()->loader().progress().willStartLoading(identifier,
request.priority());
}
@@ -559,7 +556,6 @@ void FrameFetchContext::willStartLoadingResource(
TRACE_EVENT_ASYNC_BEGIN1(
"blink.net", "Resource", identifier, "data",
loadResourceTraceData(identifier, request.url(), request.priority()));
- prepareRequest(request);
if (!m_documentLoader || m_documentLoader->fetcher()->archive() ||
!request.url().isValid())
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.h ('k') | third_party/WebKit/Source/core/loader/PingLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698