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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 return render_frame_host_; | 125 return render_frame_host_; |
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 bool NavigationHandleImpl::HasResponseHeaders() const { | |
136 return state_ >= WILL_REDIRECT_REQUEST && response_headers_.get(); | |
clamy
2016/02/09 10:42:40
nit: the state_ >= WILL_REDIRECT_REQUEST is not re
Donn Denman
2016/02/10 01:05:05
Done.
| |
137 } | |
138 | |
135 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { | 139 const net::HttpResponseHeaders* NavigationHandleImpl::GetResponseHeaders() { |
136 DCHECK(state_ >= WILL_REDIRECT_REQUEST) | 140 DCHECK(state_ >= WILL_REDIRECT_REQUEST) |
137 << "This accessor should only be called when the request encountered a " | 141 << "This accessor should only be called when the request encountered a " |
138 "redirect or received a response"; | 142 "redirect or received a response"; |
139 return response_headers_.get(); | 143 return response_headers_.get(); |
140 } | 144 } |
141 | 145 |
142 bool NavigationHandleImpl::HasCommitted() { | 146 bool NavigationHandleImpl::HasCommitted() { |
143 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; | 147 return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE; |
144 } | 148 } |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
445 complete_callback_.Reset(); | 449 complete_callback_.Reset(); |
446 | 450 |
447 if (!callback.is_null()) | 451 if (!callback.is_null()) |
448 callback.Run(result); | 452 callback.Run(result); |
449 | 453 |
450 // No code after running the callback, as it might have resulted in our | 454 // No code after running the callback, as it might have resulted in our |
451 // destruction. | 455 // destruction. |
452 } | 456 } |
453 | 457 |
454 } // namespace content | 458 } // namespace content |
OLD | NEW |