summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjohnme <johnme@chromium.org>2015-07-31 03:46:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-31 10:46:44 +0000
commitb0aaba020d13c015e8ee597f3809638ab9b58530 (patch)
tree74ee8575ec1dab55b3c1211a5a327542cbd388bf
parent4022b31bed01b4f125a44648eba3948301e7b889 (diff)
downloadchromium_src-b0aaba020d13c015e8ee597f3809638ab9b58530.zip
chromium_src-b0aaba020d13c015e8ee597f3809638ab9b58530.tar.gz
chromium_src-b0aaba020d13c015e8ee597f3809638ab9b58530.tar.bz2
Revert of 'firstPartyForCookies' walks the ancestor tree. (patchset #1 id:1 of https://codereview.chromium.org/1253923002/)
Reason for revert: This causes http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html to consistently fail on all platforms: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=http%2Ftests%2Fsecurity%2FXFrameOptions%2Fx-frame-options-deny-meta-tag-parent-same-origin-deny.html&testType=layout-tests Original issue's description: > 'firstPartyForCookies' walks the ancestor tree. > > Calling 'firstPartyForCookies' on the top level frame's document will > give a very different result then calling it on a subframe's document. > > R=nasko@chromium.org > > Committed: https://crrev.com/e91e43556ecdbf519667f55b729289fcaef9b3af > Cr-Commit-Position: refs/heads/master@{#341304} TBR=nasko@chromium.org,mkwst@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1254893004 Cr-Commit-Position: refs/heads/master@{#341310}
-rw-r--r--content/renderer/render_frame_impl.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 4bf71e7..26338e1 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3157,10 +3157,17 @@ void RenderFrameImpl::willSendRequest(
// Set the first party for cookies url if it has not been set yet (new
// requests). For redirects, it is updated by WebURLLoaderImpl.
if (request.firstPartyForCookies().isEmpty()) {
- if (request.frameType() == blink::WebURLRequest::FrameTypeTopLevel)
+ if (request.frameType() == blink::WebURLRequest::FrameTypeTopLevel) {
request.setFirstPartyForCookies(request.url());
- else
- request.setFirstPartyForCookies(frame->document().firstPartyForCookies());
+ } else {
+ // TODO(nasko): When the top-level frame is remote, there is no document.
+ // This is broken and should be fixed to propagate the first party.
+ WebFrame* top = frame->top();
+ if (top->isWebLocalFrame()) {
+ request.setFirstPartyForCookies(
+ frame->top()->document().firstPartyForCookies());
+ }
+ }
}
WebDataSource* provisional_data_source = frame->provisionalDataSource();