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

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

Issue 2207833002: Call FetchContext::dispatchWillSendRequest() only if an actual load is started (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Rebase. Created 4 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 | « third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/font-face.html ('k') | no next file » | 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 31e8389897ba03dbbff62479cf5bd80ba306983d..b57c1bbef3c98a2d53991cb54263394cad756c5c 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -463,8 +463,7 @@ Resource* ResourceFetcher::requestResource(FetchRequest& request, const Resource
updateMemoryCacheStats(resource, policy, request, factory, isStaticData);
- if (policy != Use)
- willSendRequest(identifier, request.mutableResourceRequest(), ResourceResponse(), request.options());
+ request.mutableResourceRequest().setAllowStoredCredentials(request.options().allowCredentials == AllowStoredCredentials);
switch (policy) {
case Reload:
@@ -984,6 +983,9 @@ bool ResourceFetcher::startLoad(Resource* resource)
return false;
}
+ ResourceRequest request(resource->resourceRequest());
+ willSendRequest(resource->identifier(), request, ResourceResponse(), resource->options());
+
ResourceLoader* loader = ResourceLoader::create(this, resource);
if (resource->shouldBlockLoadEvent())
m_loaders.add(loader);
@@ -992,7 +994,7 @@ bool ResourceFetcher::startLoad(Resource* resource)
storeResourceTimingInitiatorInformation(resource);
resource->setFetcherSecurityOrigin(context().getSecurityOrigin());
- loader->start(resource->resourceRequest(), context().loadingTaskRunner(), context().defersLoading());
+ loader->start(request, context().loadingTaskRunner(), context().defersLoading());
return true;
}
@@ -1058,13 +1060,13 @@ bool ResourceFetcher::willFollowRedirect(Resource* resource, ResourceRequest& ne
ResourceTimingInfoMap::iterator it = m_resourceTimingInfoMap.find(resource);
if (it != m_resourceTimingInfoMap.end())
it->value->addRedirect(redirectResponse);
+ newRequest.setAllowStoredCredentials(resource->options().allowCredentials == AllowStoredCredentials);
willSendRequest(resource->identifier(), newRequest, redirectResponse, resource->options());
return true;
}
void ResourceFetcher::willSendRequest(unsigned long identifier, ResourceRequest& newRequest, const ResourceResponse& redirectResponse, const ResourceLoaderOptions& options)
{
- newRequest.setAllowStoredCredentials(options.allowCredentials == AllowStoredCredentials);
context().dispatchWillSendRequest(identifier, newRequest, redirectResponse, options.initiatorInfo);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/network/resources/font-face.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698