| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/appcache/appcache_navigation_handle.h" | 10 #include "content/browser/appcache/appcache_navigation_handle.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() { | 258 RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() { |
| 259 // TODO(mkwst): Change this to check against 'READY_TO_COMMIT' once | 259 // TODO(mkwst): Change this to check against 'READY_TO_COMMIT' once |
| 260 // ReadyToCommitNavigation is available whether or not PlzNavigate is | 260 // ReadyToCommitNavigation is available whether or not PlzNavigate is |
| 261 // enabled. https://crbug.com/621856 | 261 // enabled. https://crbug.com/621856 |
| 262 CHECK_GE(state_, WILL_PROCESS_RESPONSE) | 262 CHECK_GE(state_, WILL_PROCESS_RESPONSE) |
| 263 << "This accessor should only be called after a response has been " | 263 << "This accessor should only be called after a response has been " |
| 264 "delivered for processing."; | 264 "delivered for processing."; |
| 265 return render_frame_host_; | 265 return render_frame_host_; |
| 266 } | 266 } |
| 267 | 267 |
| 268 bool NavigationHandleImpl::IsSamePage() { | 268 bool NavigationHandleImpl::IsSameDocument() { |
| 269 return is_same_page_; | 269 return is_same_page_; |
| 270 } | 270 } |
| 271 | 271 |
| 272 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { | 272 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { |
| 273 return response_headers_.get(); | 273 return response_headers_.get(); |
| 274 } | 274 } |
| 275 | 275 |
| 276 net::HttpResponseInfo::ConnectionInfo | 276 net::HttpResponseInfo::ConnectionInfo |
| 277 NavigationHandleImpl::GetConnectionInfo() { | 277 NavigationHandleImpl::GetConnectionInfo() { |
| 278 return connection_info_; | 278 return connection_info_; |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 if (result != NavigationThrottle::DEFER) | 616 if (result != NavigationThrottle::DEFER) |
| 617 RunCompleteCallback(result); | 617 RunCompleteCallback(result); |
| 618 } | 618 } |
| 619 | 619 |
| 620 void NavigationHandleImpl::ReadyToCommitNavigation( | 620 void NavigationHandleImpl::ReadyToCommitNavigation( |
| 621 RenderFrameHostImpl* render_frame_host) { | 621 RenderFrameHostImpl* render_frame_host) { |
| 622 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); | 622 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); |
| 623 render_frame_host_ = render_frame_host; | 623 render_frame_host_ = render_frame_host; |
| 624 state_ = READY_TO_COMMIT; | 624 state_ = READY_TO_COMMIT; |
| 625 | 625 |
| 626 if (!IsRendererDebugURL(url_) && !IsSamePage()) | 626 if (!IsRendererDebugURL(url_) && !IsSameDocument()) |
| 627 GetDelegate()->ReadyToCommitNavigation(this); | 627 GetDelegate()->ReadyToCommitNavigation(this); |
| 628 } | 628 } |
| 629 | 629 |
| 630 void NavigationHandleImpl::DidCommitNavigation( | 630 void NavigationHandleImpl::DidCommitNavigation( |
| 631 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 631 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| 632 bool did_replace_entry, | 632 bool did_replace_entry, |
| 633 const GURL& previous_url, | 633 const GURL& previous_url, |
| 634 NavigationType navigation_type, | 634 NavigationType navigation_type, |
| 635 RenderFrameHostImpl* render_frame_host) { | 635 RenderFrameHostImpl* render_frame_host) { |
| 636 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); | 636 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 if (node->current_url().EqualsIgnoringRef(url_)) { | 934 if (node->current_url().EqualsIgnoringRef(url_)) { |
| 935 if (found_self_reference) | 935 if (found_self_reference) |
| 936 return true; | 936 return true; |
| 937 found_self_reference = true; | 937 found_self_reference = true; |
| 938 } | 938 } |
| 939 } | 939 } |
| 940 return false; | 940 return false; |
| 941 } | 941 } |
| 942 | 942 |
| 943 } // namespace content | 943 } // namespace content |
| OLD | NEW |