Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2598163002: WebContentsObserver update for PlzNavigate methods (Closed)
Patch Set: Fixed AwWebContentsObserver Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index 16ae7a2fe3245fb3bc7cebced866bf43d42b180b..6e58e2ce96f54d897712fa0ae2e61492c72e61e5 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -202,9 +202,7 @@ bool NavigationHandleImpl::HasUserGesture() {
}
ui::PageTransition NavigationHandleImpl::GetPageTransition() {
- CHECK_NE(INITIAL, state_)
- << "This accessor should not be called before the request is started.";
- return transition_;
+ return state_ == INITIAL ? ui::PAGE_TRANSITION_TYPED : transition_;
}
bool NavigationHandleImpl::IsExternalProtocol() {
@@ -218,13 +216,7 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
}
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
- // TODO(mkwst): Change this to check against 'READY_TO_COMMIT' once
- // ReadyToCommitNavigation is available whether or not PlzNavigate is
- // enabled. https://crbug.com/621856
- CHECK_GE(state_, WILL_PROCESS_RESPONSE)
- << "This accessor should only be called after a response has been "
- "delivered for processing.";
- return render_frame_host_;
+ return state_ >= READY_TO_COMMIT ? render_frame_host_ : nullptr;
}
bool NavigationHandleImpl::IsSamePage() {

Powered by Google App Engine
This is Rietveld 408576698