| 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 f24999058b5f36021c507f91087d45f01b5435a8..7734ce2bb7e1d97415af0cc81804e65914342af4 100644
|
| --- a/content/browser/frame_host/navigation_handle_impl.cc
|
| +++ b/content/browser/frame_host/navigation_handle_impl.cc
|
| @@ -25,6 +25,7 @@ NavigationHandleImpl::NavigationHandleImpl(const GURL& url,
|
| net_error_code_(net::OK),
|
| state_(DID_START),
|
| is_main_frame_(is_main_frame),
|
| + render_frame_host_(nullptr),
|
| is_transferring_(false),
|
| delegate_(delegate) {
|
| delegate_->DidStartNavigation(this);
|
| @@ -46,11 +47,18 @@ bool NavigationHandleImpl::IsInMainFrame() const {
|
| return is_main_frame_;
|
| }
|
|
|
| -bool NavigationHandleImpl::HasCommittedDocument() const {
|
| - return state_ == DID_COMMIT;
|
| +RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
|
| + CHECK(state_ >= READY_TO_COMMIT)
|
| + << "This accessor should only be called "
|
| + "after the navigation is ready to commit.";
|
| + return render_frame_host_;
|
| }
|
|
|
| -bool NavigationHandleImpl::HasCommittedErrorPage() const {
|
| +bool NavigationHandleImpl::HasCommitted() {
|
| + return state_ == DID_COMMIT || state_ == DID_COMMIT_ERROR_PAGE;
|
| +}
|
| +
|
| +bool NavigationHandleImpl::IsErrorPage() {
|
| return state_ == DID_COMMIT_ERROR_PAGE;
|
| }
|
|
|
| @@ -59,9 +67,19 @@ void NavigationHandleImpl::DidRedirectNavigation(const GURL& new_url) {
|
| delegate_->DidRedirectNavigation(this);
|
| }
|
|
|
| -void NavigationHandleImpl::DidCommitNavigation() {
|
| +void NavigationHandleImpl::ReadyToCommitNavigation(
|
| + RenderFrameHostImpl* render_frame_host) {
|
| + CHECK(!render_frame_host_);
|
| + render_frame_host_ = render_frame_host;
|
| + state_ = READY_TO_COMMIT;
|
| + delegate_->ReadyToCommitNavigation(this);
|
| +}
|
| +
|
| +void NavigationHandleImpl::DidCommitNavigation(
|
| + RenderFrameHostImpl* render_frame_host) {
|
| + CHECK_IMPLIES(render_frame_host_, render_frame_host_ == render_frame_host);
|
| + render_frame_host_ = render_frame_host;
|
| state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE;
|
| - delegate_->DidCommitNavigation(this);
|
| }
|
|
|
| } // namespace content
|
|
|