| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 render_frame_host_(nullptr), | 58 render_frame_host_(nullptr), |
| 59 is_same_page_(false), | 59 is_same_page_(false), |
| 60 is_synchronous_(is_synchronous), | 60 is_synchronous_(is_synchronous), |
| 61 is_srcdoc_(is_srcdoc), | 61 is_srcdoc_(is_srcdoc), |
| 62 was_redirected_(false), | 62 was_redirected_(false), |
| 63 state_(INITIAL), | 63 state_(INITIAL), |
| 64 is_transferring_(false), | 64 is_transferring_(false), |
| 65 frame_tree_node_(frame_tree_node), | 65 frame_tree_node_(frame_tree_node), |
| 66 next_index_(0), | 66 next_index_(0), |
| 67 navigation_start_(navigation_start), | 67 navigation_start_(navigation_start), |
| 68 pending_nav_entry_id_(pending_nav_entry_id), | 68 pending_nav_entry_id_(pending_nav_entry_id) { |
| 69 is_in_commit_(false) { | |
| 70 DCHECK(!navigation_start.is_null()); | 69 DCHECK(!navigation_start.is_null()); |
| 71 GetDelegate()->DidStartNavigation(this); | 70 GetDelegate()->DidStartNavigation(this); |
| 72 } | 71 } |
| 73 | 72 |
| 74 NavigationHandleImpl::~NavigationHandleImpl() { | 73 NavigationHandleImpl::~NavigationHandleImpl() { |
| 75 GetDelegate()->DidFinishNavigation(this); | 74 GetDelegate()->DidFinishNavigation(this); |
| 76 | 75 |
| 77 CHECK(!is_in_commit_); | |
| 78 | |
| 79 // 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 |
| 80 // destroyed in the middle of the NavigationThrottles checks. | 77 // destroyed in the middle of the NavigationThrottles checks. |
| 81 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) | 78 if (!IsBrowserSideNavigationEnabled() && !complete_callback_.is_null()) |
| 82 RunCompleteCallback(NavigationThrottle::CANCEL_AND_IGNORE); | 79 RunCompleteCallback(NavigationThrottle::CANCEL_AND_IGNORE); |
| 83 } | 80 } |
| 84 | 81 |
| 85 NavigatorDelegate* NavigationHandleImpl::GetDelegate() const { | 82 NavigatorDelegate* NavigationHandleImpl::GetDelegate() const { |
| 86 return frame_tree_node_->navigator()->GetDelegate(); | 83 return frame_tree_node_->navigator()->GetDelegate(); |
| 87 } | 84 } |
| 88 | 85 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 complete_callback_.Reset(); | 482 complete_callback_.Reset(); |
| 486 | 483 |
| 487 if (!callback.is_null()) | 484 if (!callback.is_null()) |
| 488 callback.Run(result); | 485 callback.Run(result); |
| 489 | 486 |
| 490 // No code after running the callback, as it might have resulted in our | 487 // No code after running the callback, as it might have resulted in our |
| 491 // destruction. | 488 // destruction. |
| 492 } | 489 } |
| 493 | 490 |
| 494 } // namespace content | 491 } // namespace content |
| OLD | NEW |