| 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 <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 270 } |
| 271 | 271 |
| 272 bool NavigationHandleImpl::HasCommitted() { | 272 bool NavigationHandleImpl::HasCommitted() { |
| 273 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; | 273 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; |
| 274 } | 274 } |
| 275 | 275 |
| 276 bool NavigationHandleImpl::IsErrorPage() { | 276 bool NavigationHandleImpl::IsErrorPage() { |
| 277 return state_ == DID_COMMIT_ERROR_PAGE; | 277 return state_ == DID_COMMIT_ERROR_PAGE; |
| 278 } | 278 } |
| 279 | 279 |
| 280 net::HostPortPair NavigationHandleImpl::GetSocketAddress() { |
| 281 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE); |
| 282 return socket_address_; |
| 283 } |
| 284 |
| 280 void NavigationHandleImpl::Resume() { | 285 void NavigationHandleImpl::Resume() { |
| 281 if (state_ != DEFERRING_START && state_ != DEFERRING_REDIRECT && | 286 if (state_ != DEFERRING_START && state_ != DEFERRING_REDIRECT && |
| 282 state_ != DEFERRING_RESPONSE) { | 287 state_ != DEFERRING_RESPONSE) { |
| 283 return; | 288 return; |
| 284 } | 289 } |
| 285 | 290 |
| 286 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; | 291 NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; |
| 287 if (state_ == DEFERRING_START) { | 292 if (state_ == DEFERRING_START) { |
| 288 result = CheckWillStartRequest(); | 293 result = CheckWillStartRequest(); |
| 289 } else if (state_ == DEFERRING_REDIRECT) { | 294 } else if (state_ == DEFERRING_REDIRECT) { |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 bool same_page, | 578 bool same_page, |
| 574 RenderFrameHostImpl* render_frame_host) { | 579 RenderFrameHostImpl* render_frame_host) { |
| 575 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); | 580 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); |
| 576 DCHECK_EQ(frame_tree_node_, render_frame_host->frame_tree_node()); | 581 DCHECK_EQ(frame_tree_node_, render_frame_host->frame_tree_node()); |
| 577 CHECK_EQ(url_, params.url); | 582 CHECK_EQ(url_, params.url); |
| 578 | 583 |
| 579 method_ = params.method; | 584 method_ = params.method; |
| 580 has_user_gesture_ = (params.gesture == NavigationGestureUser); | 585 has_user_gesture_ = (params.gesture == NavigationGestureUser); |
| 581 transition_ = params.transition; | 586 transition_ = params.transition; |
| 582 render_frame_host_ = render_frame_host; | 587 render_frame_host_ = render_frame_host; |
| 588 base_url_ = params.base_url; |
| 589 socket_address_ = params.socket_address; |
| 583 | 590 |
| 584 // If an error page reloads, net_error_code might be 200 but we still want to | 591 // If an error page reloads, net_error_code might be 200 but we still want to |
| 585 // count it as an error page. | 592 // count it as an error page. |
| 586 if (params.base_url.spec() == kUnreachableWebDataURL || | 593 if (params.base_url.spec() == kUnreachableWebDataURL || |
| 587 net_error_code_ != net::OK) { | 594 net_error_code_ != net::OK) { |
| 588 state_ = DID_COMMIT_ERROR_PAGE; | 595 state_ = DID_COMMIT_ERROR_PAGE; |
| 589 } else { | 596 } else { |
| 590 state_ = DID_COMMIT; | 597 state_ = DID_COMMIT; |
| 591 } | 598 } |
| 592 } | 599 } |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 content::AncestorThrottle::MaybeCreateThrottleFor(this); | 841 content::AncestorThrottle::MaybeCreateThrottleFor(this); |
| 835 if (ancestor_throttle) | 842 if (ancestor_throttle) |
| 836 throttles_.push_back(std::move(ancestor_throttle)); | 843 throttles_.push_back(std::move(ancestor_throttle)); |
| 837 | 844 |
| 838 throttles_.insert(throttles_.begin(), | 845 throttles_.insert(throttles_.begin(), |
| 839 std::make_move_iterator(throttles_to_register.begin()), | 846 std::make_move_iterator(throttles_to_register.begin()), |
| 840 std::make_move_iterator(throttles_to_register.end())); | 847 std::make_move_iterator(throttles_to_register.end())); |
| 841 } | 848 } |
| 842 | 849 |
| 843 } // namespace content | 850 } // namespace content |
| OLD | NEW |