Commit 8355de45 authored by Mike West's avatar Mike West Committed by Commit Bot

Use an opaque URL rather than an empty URL for request's site for cookies.

Apparently this makes a big difference to the cookie settings backend.

Bug: 881715
Change-Id: Id87fa0c6a858bae6a3f8fff4d6af3f974b00d5e4
Reviewed-on: https://chromium-review.googlesource.com/1212846
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589512}
parent 2303c8fe
...@@ -1345,7 +1345,7 @@ void NavigationRequest::OnStartChecksComplete( ...@@ -1345,7 +1345,7 @@ void NavigationRequest::OnStartChecksComplete(
: frame_tree_node_->frame_tree()->root()->current_url(); : frame_tree_node_->frame_tree()->root()->current_url();
// Walk the ancestor chain to determine whether all frames are same-site. If // Walk the ancestor chain to determine whether all frames are same-site. If
// not, the |site_for_cookies| is set to an empty URL. // not, the |site_for_cookies| is set to an opaque URL.
// //
// TODO(mkwst): This is incorrect. It ought to use the definition from // TODO(mkwst): This is incorrect. It ought to use the definition from
// 'Document::SiteForCookies()' in Blink, which special-cases extension // 'Document::SiteForCookies()' in Blink, which special-cases extension
...@@ -1360,11 +1360,12 @@ void NavigationRequest::OnStartChecksComplete( ...@@ -1360,11 +1360,12 @@ void NavigationRequest::OnStartChecksComplete(
} }
current = current->parent(); current = current->parent();
} }
const GURL& site_for_cookies = const GURL& site_for_cookies =
ancestors_are_same_site (ancestors_are_same_site || !base_url.is_empty())
? (frame_tree_node_->IsMainFrame() ? common_params_.url ? (frame_tree_node_->IsMainFrame() ? common_params_.url
: top_document_url) : top_document_url)
: GURL::EmptyGURL(); : GURL("data:,");
bool parent_is_main_frame = !frame_tree_node_->parent() bool parent_is_main_frame = !frame_tree_node_->parent()
? false ? false
: frame_tree_node_->parent()->IsMainFrame(); : frame_tree_node_->parent()->IsMainFrame();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment