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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 2639073002: Convert OverscrollNavigationOverlayTest.ImmediateLoadOnNavigate to use the new navigation callbacks… (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 895d3891a6ca6662039bd1f7a5bf949729ed204b..a047b10686475e946f87bc5cd09d262fbb5026a3 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -381,13 +381,24 @@ void NavigationRequest::BeginNavigation() {
}
void NavigationRequest::CreateNavigationHandle(int pending_nav_entry_id) {
+ DCHECK_EQ(frame_tree_node_->navigation_request(), this);
// TODO(nasko): Update the NavigationHandle creation to ensure that the
// proper values are specified for is_same_page.
- navigation_handle_ = NavigationHandleImpl::Create(
- common_params_.url, frame_tree_node_, !browser_initiated_,
- false, // is_same_page
- common_params_.navigation_start, pending_nav_entry_id,
- false); // started_in_context_menu
+ FrameTreeNode* frame_tree_node = frame_tree_node_;
+ std::unique_ptr<NavigationHandleImpl> navigation_handle =
+ NavigationHandleImpl::Create(
+ common_params_.url, frame_tree_node_, !browser_initiated_,
+ false, // is_same_page
+ common_params_.navigation_start, pending_nav_entry_id,
+ false); // started_in_context_menu
+
+ if (!frame_tree_node->navigation_request()) {
+ // A callback could have cancelled this request synchronously in which case
+ // |this| is deleted.
+ return;
+ }
+
+ navigation_handle_ = std::move(navigation_handle);
if (!begin_params_.searchable_form_url.is_empty()) {
navigation_handle_->set_searchable_form_url(
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698