OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 NavigationThrottle::ThrottleCheckResult result) { | 26 NavigationThrottle::ThrottleCheckResult result) { |
27 *to_update = result; | 27 *to_update = result; |
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 const base::TimeTicks& navigation_start) { | 36 const base::TimeTicks& navigation_start, |
37 return scoped_ptr<NavigationHandleImpl>( | 37 int pending_nav_entry_id) { |
38 new NavigationHandleImpl(url, frame_tree_node, navigation_start)); | 38 return scoped_ptr<NavigationHandleImpl>(new NavigationHandleImpl( |
| 39 url, frame_tree_node, navigation_start, pending_nav_entry_id)); |
39 } | 40 } |
40 | 41 |
41 NavigationHandleImpl::NavigationHandleImpl( | 42 NavigationHandleImpl::NavigationHandleImpl( |
42 const GURL& url, | 43 const GURL& url, |
43 FrameTreeNode* frame_tree_node, | 44 FrameTreeNode* frame_tree_node, |
44 const base::TimeTicks& navigation_start) | 45 const base::TimeTicks& navigation_start, |
| 46 int pending_nav_entry_id) |
45 : url_(url), | 47 : url_(url), |
46 is_post_(false), | 48 is_post_(false), |
47 has_user_gesture_(false), | 49 has_user_gesture_(false), |
48 transition_(ui::PAGE_TRANSITION_LINK), | 50 transition_(ui::PAGE_TRANSITION_LINK), |
49 is_external_protocol_(false), | 51 is_external_protocol_(false), |
50 net_error_code_(net::OK), | 52 net_error_code_(net::OK), |
51 render_frame_host_(nullptr), | 53 render_frame_host_(nullptr), |
52 is_same_page_(false), | 54 is_same_page_(false), |
53 state_(INITIAL), | 55 state_(INITIAL), |
54 is_transferring_(false), | 56 is_transferring_(false), |
55 frame_tree_node_(frame_tree_node), | 57 frame_tree_node_(frame_tree_node), |
56 next_index_(0), | 58 next_index_(0), |
57 navigation_start_(navigation_start) { | 59 navigation_start_(navigation_start), |
| 60 pending_nav_entry_id_(pending_nav_entry_id) { |
58 DCHECK(!navigation_start.is_null()); | 61 DCHECK(!navigation_start.is_null()); |
59 GetDelegate()->DidStartNavigation(this); | 62 GetDelegate()->DidStartNavigation(this); |
60 } | 63 } |
61 | 64 |
62 NavigationHandleImpl::~NavigationHandleImpl() { | 65 NavigationHandleImpl::~NavigationHandleImpl() { |
63 GetDelegate()->DidFinishNavigation(this); | 66 GetDelegate()->DidFinishNavigation(this); |
64 | 67 |
65 // Cancel the navigation on the IO thread if the NavigationHandle is being | 68 // Cancel the navigation on the IO thread if the NavigationHandle is being |
66 // destroyed in the middle of the NavigationThrottles checks. | 69 // destroyed in the middle of the NavigationThrottles checks. |
67 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) | 70 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 complete_callback_.Reset(); | 448 complete_callback_.Reset(); |
446 | 449 |
447 if (!callback.is_null()) | 450 if (!callback.is_null()) |
448 callback.Run(result); | 451 callback.Run(result); |
449 | 452 |
450 // No code after running the callback, as it might have resulted in our | 453 // No code after running the callback, as it might have resulted in our |
451 // destruction. | 454 // destruction. |
452 } | 455 } |
453 | 456 |
454 } // namespace content | 457 } // namespace content |
OLD | NEW |