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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 bool NavigationHandleImpl::HasCommitted() { | 141 bool NavigationHandleImpl::HasCommitted() { |
142 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; | 142 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; |
143 } | 143 } |
144 | 144 |
145 bool NavigationHandleImpl::IsErrorPage() { | 145 bool NavigationHandleImpl::IsErrorPage() { |
146 return state_ == DID_COMMIT_ERROR_PAGE; | 146 return state_ == DID_COMMIT_ERROR_PAGE; |
147 } | 147 } |
148 | 148 |
149 void NavigationHandleImpl::Resume() { | 149 void NavigationHandleImpl::Resume() { |
150 CHECK(state_ == DEFERRING_START || state_ == DEFERRING_REDIRECT); | 150 if (state_ != DEFERRING_START && state_ != DEFERRING_REDIRECT) |
| 151 return; |
| 152 |
151 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; | 153 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; |
152 if (state_ == DEFERRING_START) { | 154 if (state_ == DEFERRING_START) { |
153 result = CheckWillStartRequest(); | 155 result = CheckWillStartRequest(); |
154 } else { | 156 } else { |
155 result = CheckWillRedirectRequest(); | 157 result = CheckWillRedirectRequest(); |
156 } | 158 } |
157 | 159 |
158 if (result != NavigationThrottle::DEFER) | 160 if (result != NavigationThrottle::DEFER) |
159 RunCompleteCallback(result); | 161 RunCompleteCallback(result); |
160 } | 162 } |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 void NavigationHandleImpl::RunCompleteCallback( | 372 void NavigationHandleImpl::RunCompleteCallback( |
371 NavigationThrottle::ThrottleCheckResult result) { | 373 NavigationThrottle::ThrottleCheckResult result) { |
372 DCHECK(result != NavigationThrottle::DEFER); | 374 DCHECK(result != NavigationThrottle::DEFER); |
373 if (!complete_callback_.is_null()) | 375 if (!complete_callback_.is_null()) |
374 complete_callback_.Run(result); | 376 complete_callback_.Run(result); |
375 | 377 |
376 complete_callback_.Reset(); | 378 complete_callback_.Reset(); |
377 } | 379 } |
378 | 380 |
379 } // namespace content | 381 } // namespace content |
OLD | NEW |