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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 bool NavigationHandleImpl::IsSamePage() { | 128 bool NavigationHandleImpl::IsSamePage() { |
129 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE) | 129 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE) |
130 << "This accessor should not be called before the navigation has " | 130 << "This accessor should not be called before the navigation has " |
131 "committed."; | 131 "committed."; |
132 return is_same_page_; | 132 return is_same_page_; |
133 } | 133 } |
134 | 134 |
135 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { | 135 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { |
136 DCHECK(state_ >= WILL_REDIRECT_REQUEST) | |
137 << "This accessor should only be called when the request encountered a " | |
138 "redirect or received a response"; | |
139 return response_headers_.get(); | 136 return response_headers_.get(); |
140 } | 137 } |
141 | 138 |
142 bool NavigationHandleImpl::HasCommitted() { | 139 bool NavigationHandleImpl::HasCommitted() { |
143 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; | 140 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; |
144 } | 141 } |
145 | 142 |
146 bool NavigationHandleImpl::IsErrorPage() { | 143 bool NavigationHandleImpl::IsErrorPage() { |
147 return state_ == DID_COMMIT_ERROR_PAGE; | 144 return state_ == DID_COMMIT_ERROR_PAGE; |
148 } | 145 } |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 complete_callback_.Reset(); | 442 complete_callback_.Reset(); |
446 | 443 |
447 if (!callback.is_null()) | 444 if (!callback.is_null()) |
448 callback.Run(result); | 445 callback.Run(result); |
449 | 446 |
450 // No code after running the callback, as it might have resulted in our | 447 // No code after running the callback, as it might have resulted in our |
451 // destruction. | 448 // destruction. |
452 } | 449 } |
453 | 450 |
454 } // namespace content | 451 } // namespace content |
OLD | NEW |