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

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

Issue 314093002: Remove the setting of first party for cookies from addAdditionalRequestHeaders (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed compilation error Created 6 years, 6 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') | Source/core/loader/PingLoader.cpp » ('j') | 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 10cf220cb632cf3294180df887a7f02bc923d372..493bfcf05a555c09f191d02c07f625092cbd6be1 100644
--- a/Source/core/loader/FrameFetchContext.cpp
+++ b/Source/core/loader/FrameFetchContext.cpp
@@ -78,11 +78,6 @@ void FrameFetchContext::addAdditionalRequestHeaders(Document* document, Resource
FrameLoader::addHTTPOriginIfNeeded(request, AtomicString(outgoingOrigin));
}
- if (isMainResource && m_frame->isMainFrame())
- request.setFirstPartyForCookies(request.url());
- else if (m_frame->tree().top()->isLocalFrame())
- request.setFirstPartyForCookies(toLocalFrame(m_frame->tree().top())->document()->firstPartyForCookies());
-
// The remaining modifications are only necessary for HTTP and HTTPS.
if (!request.url().isEmpty() && !request.url().protocolIsInHTTPFamily())
return;
@@ -93,6 +88,12 @@ void FrameFetchContext::addAdditionalRequestHeaders(Document* document, Resource
FrameLoader::addHTTPOriginIfNeeded(request, nullAtom);
}
+void FrameFetchContext::setFirstPartyForCookies(ResourceRequest& request)
+{
+ if (m_frame->tree().top()->isLocalFrame())
+ request.setFirstPartyForCookies(toLocalFrame(m_frame->tree().top())->document()->firstPartyForCookies());
+}
+
CachePolicy FrameFetchContext::cachePolicy(Document* document) const
{
if (document && document->loadEventFinished())
« no previous file with comments | « Source/core/loader/FrameFetchContext.h ('k') | Source/core/loader/PingLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698