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/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 CHECK_NE(INITIAL, state_) | 176 CHECK_NE(INITIAL, state_) |
177 << "This accessor should not be called before the request is started."; | 177 << "This accessor should not be called before the request is started."; |
178 return is_external_protocol_; | 178 return is_external_protocol_; |
179 } | 179 } |
180 | 180 |
181 net::Error NavigationHandleImpl::GetNetErrorCode() { | 181 net::Error NavigationHandleImpl::GetNetErrorCode() { |
182 return net_error_code_; | 182 return net_error_code_; |
183 } | 183 } |
184 | 184 |
185 RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() { | 185 RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() { |
186 CHECK(state_ >= READY_TO_COMMIT) | 186 CHECK_GE(state_, WILL_PROCESS_RESPONSE) |
187 << "This accessor should only be called " | 187 << "This accessor should only be called after a response has been " |
188 "after the navigation is ready to commit."; | 188 "delivered for processing."; |
nasko
2016/06/24 16:08:41
I'm afraid of making this change. Mainly because w
| |
189 return render_frame_host_; | 189 return render_frame_host_; |
190 } | 190 } |
191 | 191 |
192 bool NavigationHandleImpl::IsSamePage() { | 192 bool NavigationHandleImpl::IsSamePage() { |
193 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE) | 193 DCHECK(state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE) |
194 << "This accessor should not be called before the navigation has " | 194 << "This accessor should not be called before the navigation has " |
195 "committed."; | 195 "committed."; |
196 return is_same_page_; | 196 return is_same_page_; |
197 } | 197 } |
198 | 198 |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
532 complete_callback_.Reset(); | 532 complete_callback_.Reset(); |
533 | 533 |
534 if (!callback.is_null()) | 534 if (!callback.is_null()) |
535 callback.Run(result); | 535 callback.Run(result); |
536 | 536 |
537 // No code after running the callback, as it might have resulted in our | 537 // No code after running the callback, as it might have resulted in our |
538 // destruction. | 538 // destruction. |
539 } | 539 } |
540 | 540 |
541 } // namespace content | 541 } // namespace content |
OLD | NEW |