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

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

Issue 2411693003: Move blocking of top-level navigations to nested URLs with extension origins from non-extension pro… (Closed)
Patch Set: Created 4 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 <utility> 7 #include <utility>
8 8
9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 // Inform the NavigationHandle that the navigation will commit. 292 // Inform the NavigationHandle that the navigation will commit.
293 navigation_handle_->ReadyToCommitNavigation(render_frame_host); 293 navigation_handle_->ReadyToCommitNavigation(render_frame_host);
294 294
295 CommitNavigation(); 295 CommitNavigation();
296 } 296 }
297 297
298 void NavigationRequest::CreateNavigationHandle(int pending_nav_entry_id) { 298 void NavigationRequest::CreateNavigationHandle(int pending_nav_entry_id) {
299 // TODO(nasko): Update the NavigationHandle creation to ensure that the 299 // TODO(nasko): Update the NavigationHandle creation to ensure that the
300 // proper values are specified for is_synchronous and is_srcdoc. 300 // proper values are specified for is_synchronous and is_srcdoc.
301 RenderFrameHostImpl* render_frame_host =
302 frame_tree_node_->render_manager()->GetFrameHostForNavigation(*this);
nasko 2016/10/12 17:00:35 This is not going to give you the correct RFH. It
alexmos 2016/10/12 17:18:16 To double-check what happens (since I was confused
jam 2016/10/12 22:10:45 thanks, I added a test based on your description a
alexmos 2016/10/12 23:13:28 Thanks, the test looks nice and makes it very clea
301 navigation_handle_ = NavigationHandleImpl::Create( 303 navigation_handle_ = NavigationHandleImpl::Create(
302 common_params_.url, frame_tree_node_, !browser_initiated_, 304 common_params_.url, render_frame_host->GetSiteInstance()->GetSiteURL(),
305 frame_tree_node_, !browser_initiated_,
303 false, // is_synchronous 306 false, // is_synchronous
304 false, // is_srcdoc 307 false, // is_srcdoc
305 common_params_.navigation_start, pending_nav_entry_id, 308 common_params_.navigation_start, pending_nav_entry_id,
306 false); // started_in_context_menu 309 false); // started_in_context_menu
307 } 310 }
308 311
309 void NavigationRequest::TransferNavigationHandleOwnership( 312 void NavigationRequest::TransferNavigationHandleOwnership(
310 RenderFrameHostImpl* render_frame_host) { 313 RenderFrameHostImpl* render_frame_host) {
311 render_frame_host->SetNavigationHandle(std::move(navigation_handle_)); 314 render_frame_host->SetNavigationHandle(std::move(navigation_handle_));
312 } 315 }
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 562 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
560 563
561 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 564 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
562 common_params_, request_params_, 565 common_params_, request_params_,
563 is_view_source_); 566 is_view_source_);
564 567
565 frame_tree_node_->ResetNavigationRequest(true); 568 frame_tree_node_->ResetNavigationRequest(true);
566 } 569 }
567 570
568 } // namespace content 571 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698