| 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 "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 10 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } | 199 } |
| 200 | 200 |
| 201 bool NavigationHandleImpl::IsSamePage() { | 201 bool NavigationHandleImpl::IsSamePage() { |
| 202 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE) | 202 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE) |
| 203 << "This accessor should not be called before the navigation has " | 203 << "This accessor should not be called before the navigation has " |
| 204 "committed."; | 204 "committed."; |
| 205 return is_same_page_; | 205 return is_same_page_; |
| 206 } | 206 } |
| 207 | 207 |
| 208 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { | 208 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { |
| 209 return response_headers_.get(); | 209 DCHECK_GE(state_, WILL_REDIRECT_REQUEST); |
| 210 return response_headers_.get(); |
| 210 } | 211 } |
| 211 | 212 |
| 212 bool NavigationHandleImpl::HasCommitted() { | 213 bool NavigationHandleImpl::HasCommitted() { |
| 213 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; | 214 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; |
| 214 } | 215 } |
| 215 | 216 |
| 216 bool NavigationHandleImpl::IsErrorPage() { | 217 bool NavigationHandleImpl::IsErrorPage() { |
| 217 return state_ == DID_COMMIT_ERROR_PAGE; | 218 return state_ == DID_COMMIT_ERROR_PAGE; |
| 218 } | 219 } |
| 219 | 220 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 throttles_to_register.end()); | 558 throttles_to_register.end()); |
| 558 throttles_to_register.weak_clear(); | 559 throttles_to_register.weak_clear(); |
| 559 } | 560 } |
| 560 std::unique_ptr<NavigationThrottle> devtools_throttle = | 561 std::unique_ptr<NavigationThrottle> devtools_throttle = |
| 561 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); | 562 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); |
| 562 if (devtools_throttle) | 563 if (devtools_throttle) |
| 563 throttles_.push_back(devtools_throttle.release()); | 564 throttles_.push_back(devtools_throttle.release()); |
| 564 } | 565 } |
| 565 | 566 |
| 566 } // namespace content | 567 } // namespace content |
| OLD | NEW |