Chromium Code Reviews| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/browser/frame_host/frame_tree_node.h" | 8 #include "content/browser/frame_host/frame_tree_node.h" |
| 9 #include "content/browser/frame_host/navigator.h" | 9 #include "content/browser/frame_host/navigator.h" |
| 10 #include "content/browser/frame_host/navigator_delegate.h" | 10 #include "content/browser/frame_host/navigator_delegate.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 } | 299 } |
| 300 | 300 |
| 301 void NavigationHandleImpl::DidRedirectNavigation(const GURL& new_url) { | 301 void NavigationHandleImpl::DidRedirectNavigation(const GURL& new_url) { |
| 302 url_ = new_url; | 302 url_ = new_url; |
| 303 GetDelegate()->DidRedirectNavigation(this); | 303 GetDelegate()->DidRedirectNavigation(this); |
| 304 } | 304 } |
| 305 | 305 |
| 306 void NavigationHandleImpl::ReadyToCommitNavigation( | 306 void NavigationHandleImpl::ReadyToCommitNavigation( |
| 307 RenderFrameHostImpl* render_frame_host, | 307 RenderFrameHostImpl* render_frame_host, |
| 308 scoped_refptr<net::HttpResponseHeaders> response_headers) { | 308 scoped_refptr<net::HttpResponseHeaders> response_headers) { |
| 309 DCHECK(!render_frame_host_); | 309 // DCHECK(!render_frame_host_); |
|
falken
2015/11/26 10:36:42
clamy: How bad is disabling this DCHECK?
| |
| 310 render_frame_host_ = render_frame_host; | 310 render_frame_host_ = render_frame_host; |
| 311 response_headers_ = response_headers; | 311 response_headers_ = response_headers; |
| 312 state_ = READY_TO_COMMIT; | 312 state_ = READY_TO_COMMIT; |
| 313 | 313 |
| 314 // Only notify the WebContentsObservers when PlzNavigate is enabled, as | 314 // Only notify the WebContentsObservers when PlzNavigate is enabled, as |
| 315 // |render_frame_host_| may be wrong in the case of transfer navigations. | 315 // |render_frame_host_| may be wrong in the case of transfer navigations. |
| 316 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 316 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 317 switches::kEnableBrowserSideNavigation)) { | 317 switches::kEnableBrowserSideNavigation)) { |
| 318 GetDelegate()->ReadyToCommitNavigation(this); | 318 GetDelegate()->ReadyToCommitNavigation(this); |
| 319 } | 319 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 void NavigationHandleImpl::RunCompleteCallback( | 393 void NavigationHandleImpl::RunCompleteCallback( |
| 394 NavigationThrottle::ThrottleCheckResult result) { | 394 NavigationThrottle::ThrottleCheckResult result) { |
| 395 DCHECK(result != NavigationThrottle::DEFER); | 395 DCHECK(result != NavigationThrottle::DEFER); |
| 396 if (!complete_callback_.is_null()) | 396 if (!complete_callback_.is_null()) |
| 397 complete_callback_.Run(result); | 397 complete_callback_.Run(result); |
| 398 | 398 |
| 399 complete_callback_.Reset(); | 399 complete_callback_.Reset(); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace content | 402 } // namespace content |
| OLD | NEW |