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

Side by Side Diff: content/browser/frame_host/navigation_request.cc

Issue 1411813003: Teach URLRequest about initiator checks for First-Party-Only cookies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/navigation_request.h" 5 #include "content/browser/frame_host/navigation_request.h"
6 6
7 #include "content/browser/frame_host/frame_tree.h" 7 #include "content/browser/frame_host/frame_tree.h"
8 #include "content/browser/frame_host/frame_tree_node.h" 8 #include "content/browser/frame_host/frame_tree_node.h"
9 #include "content/browser/frame_host/navigation_controller_impl.h" 9 #include "content/browser/frame_host/navigation_controller_impl.h"
10 #include "content/browser/frame_host/navigation_handle_impl.h" 10 #include "content/browser/frame_host/navigation_handle_impl.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 restore_type_ = entry->restore_type(); 167 restore_type_ = entry->restore_type();
168 is_view_source_ = entry->IsViewSourceMode(); 168 is_view_source_ = entry->IsViewSourceMode();
169 bindings_ = entry->bindings(); 169 bindings_ = entry->bindings();
170 } else { 170 } else {
171 // This is needed to have about:blank and data URLs commit in the same 171 // This is needed to have about:blank and data URLs commit in the same
172 // SiteInstance as the initiating renderer. 172 // SiteInstance as the initiating renderer.
173 source_site_instance_ = 173 source_site_instance_ =
174 frame_tree_node->current_frame_host()->GetSiteInstance(); 174 frame_tree_node->current_frame_host()->GetSiteInstance();
175 } 175 }
176 176
177 // TODO(mkwst): This is incorrect. It ought to use the definition from
178 // 'Document::firstPartyForCookies()' in Blink, which walks the ancestor tree
179 // and verifies that all origins are PSL-matches (and special-cases extension
180 // URLs).
nasko 2015/10/20 22:36:30 Is this TODO going to be addressed in this CL?
Mike West 2015/10/22 13:17:02 No. It's just something I noticed in passing.
177 const GURL& first_party_for_cookies = 181 const GURL& first_party_for_cookies =
178 frame_tree_node->IsMainFrame() 182 frame_tree_node->IsMainFrame()
179 ? common_params.url 183 ? common_params.url
180 : frame_tree_node->frame_tree()->root()->current_url(); 184 : frame_tree_node->frame_tree()->root()->current_url();
181 bool parent_is_main_frame = !frame_tree_node->parent() ? 185 bool parent_is_main_frame = !frame_tree_node->parent() ?
182 false : frame_tree_node->parent()->IsMainFrame(); 186 false : frame_tree_node->parent()->IsMainFrame();
183 info_.reset(new NavigationRequestInfo( 187 info_.reset(new NavigationRequestInfo(
184 common_params, begin_params, first_party_for_cookies, 188 common_params, begin_params, first_party_for_cookies,
185 frame_tree_node->IsMainFrame(), parent_is_main_frame, 189 frame_tree_node->frame_origin(), frame_tree_node->IsMainFrame(),
186 frame_tree_node->frame_tree_node_id(), body)); 190 parent_is_main_frame, frame_tree_node->frame_tree_node_id(), body));
187 } 191 }
188 192
189 NavigationRequest::~NavigationRequest() { 193 NavigationRequest::~NavigationRequest() {
190 } 194 }
191 195
192 bool NavigationRequest::BeginNavigation() { 196 bool NavigationRequest::BeginNavigation() {
193 DCHECK(!loader_); 197 DCHECK(!loader_);
194 DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE); 198 DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE);
195 state_ = STARTED; 199 state_ = STARTED;
196 200
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 frame_tree_node_->navigator()->FailedNavigation( 285 frame_tree_node_->navigator()->FailedNavigation(
282 frame_tree_node_, has_stale_copy_in_cache, net_error); 286 frame_tree_node_, has_stale_copy_in_cache, net_error);
283 } 287 }
284 288
285 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) { 289 void NavigationRequest::OnRequestStarted(base::TimeTicks timestamp) {
286 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp, 290 frame_tree_node_->navigator()->LogResourceRequestTime(timestamp,
287 common_params_.url); 291 common_params_.url);
288 } 292 }
289 293
290 } // namespace content 294 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698