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

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

Issue 1661423002: Solidify Entry discarding logic (NavigationHandle keeps its ID) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge @377292 Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_handle_impl.h" 5 #include "content/browser/frame_host/navigation_handle_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/frame_host/frame_tree_node.h" 9 #include "content/browser/frame_host/frame_tree_node.h"
10 #include "content/browser/frame_host/navigator.h" 10 #include "content/browser/frame_host/navigator.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 } // namespace 30 } // namespace
31 31
32 // static 32 // static
33 scoped_ptr<NavigationHandleImpl> NavigationHandleImpl::Create( 33 scoped_ptr<NavigationHandleImpl> NavigationHandleImpl::Create(
34 const GURL& url, 34 const GURL& url,
35 FrameTreeNode* frame_tree_node, 35 FrameTreeNode* frame_tree_node,
36 bool is_synchronous, 36 bool is_synchronous,
37 bool is_srcdoc, 37 bool is_srcdoc,
38 const base::TimeTicks& navigation_start) { 38 const base::TimeTicks& navigation_start,
39 return scoped_ptr<NavigationHandleImpl>(new NavigationHandleImpl( 39 int pending_nav_entry_id) {
40 url, frame_tree_node, is_synchronous, is_srcdoc, navigation_start)); 40 return scoped_ptr<NavigationHandleImpl>(
41 new NavigationHandleImpl(url, frame_tree_node, is_synchronous, is_srcdoc,
42 navigation_start, pending_nav_entry_id));
41 } 43 }
42 44
43 NavigationHandleImpl::NavigationHandleImpl( 45 NavigationHandleImpl::NavigationHandleImpl(
44 const GURL& url, 46 const GURL& url,
45 FrameTreeNode* frame_tree_node, 47 FrameTreeNode* frame_tree_node,
46 bool is_synchronous, 48 bool is_synchronous,
47 bool is_srcdoc, 49 bool is_srcdoc,
48 const base::TimeTicks& navigation_start) 50 const base::TimeTicks& navigation_start,
51 int pending_nav_entry_id)
49 : url_(url), 52 : url_(url),
50 is_post_(false), 53 is_post_(false),
51 has_user_gesture_(false), 54 has_user_gesture_(false),
52 transition_(ui::PAGE_TRANSITION_LINK), 55 transition_(ui::PAGE_TRANSITION_LINK),
53 is_external_protocol_(false), 56 is_external_protocol_(false),
54 net_error_code_(net::OK), 57 net_error_code_(net::OK),
55 render_frame_host_(nullptr), 58 render_frame_host_(nullptr),
56 is_same_page_(false), 59 is_same_page_(false),
57 is_synchronous_(is_synchronous), 60 is_synchronous_(is_synchronous),
58 is_srcdoc_(is_srcdoc), 61 is_srcdoc_(is_srcdoc),
59 was_redirected_(false), 62 was_redirected_(false),
60 state_(INITIAL), 63 state_(INITIAL),
61 is_transferring_(false), 64 is_transferring_(false),
62 frame_tree_node_(frame_tree_node), 65 frame_tree_node_(frame_tree_node),
63 next_index_(0), 66 next_index_(0),
64 navigation_start_(navigation_start) { 67 navigation_start_(navigation_start),
68 pending_nav_entry_id_(pending_nav_entry_id) {
65 DCHECK(!navigation_start.is_null()); 69 DCHECK(!navigation_start.is_null());
66 GetDelegate()->DidStartNavigation(this); 70 GetDelegate()->DidStartNavigation(this);
67 } 71 }
68 72
69 NavigationHandleImpl::~NavigationHandleImpl() { 73 NavigationHandleImpl::~NavigationHandleImpl() {
70 GetDelegate()->DidFinishNavigation(this); 74 GetDelegate()->DidFinishNavigation(this);
71 75
72 // Cancel the navigation on the IO thread if the NavigationHandle is being 76 // Cancel the navigation on the IO thread if the NavigationHandle is being
73 // destroyed in the middle of the NavigationThrottles checks. 77 // destroyed in the middle of the NavigationThrottles checks.
74 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) 78 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null())
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 complete_callback_.Reset(); 484 complete_callback_.Reset();
481 485
482 if (!callback.is_null()) 486 if (!callback.is_null())
483 callback.Run(result); 487 callback.Run(result);
484 488
485 // No code after running the callback, as it might have resulted in our 489 // No code after running the callback, as it might have resulted in our
486 // destruction. 490 // destruction.
487 } 491 }
488 492
489 } // namespace content 493 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698