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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 1856693002: Revert of Ensure RenderFrameHost & NavigationHandle are not destroyed during commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 ui::PAGE_TRANSITION_FORWARD_BACK)) { 589 ui::PAGE_TRANSITION_FORWARD_BACK)) {
590 transition_type = ui::PageTransitionFromInt( 590 transition_type = ui::PageTransitionFromInt(
591 params.transition | ui::PAGE_TRANSITION_FORWARD_BACK); 591 params.transition | ui::PAGE_TRANSITION_FORWARD_BACK);
592 } 592 }
593 593
594 delegate_->DidCommitProvisionalLoad(render_frame_host, 594 delegate_->DidCommitProvisionalLoad(render_frame_host,
595 params.url, 595 params.url,
596 transition_type); 596 transition_type);
597 render_frame_host->navigation_handle()->DidCommitNavigation( 597 render_frame_host->navigation_handle()->DidCommitNavigation(
598 params, is_navigation_within_page, render_frame_host); 598 params, is_navigation_within_page, render_frame_host);
599
600 // TODO(clamy): Remove this once enough data has been gathered for
601 // crbug.com/589365.
602 render_frame_host->navigation_handle()->set_is_in_commit(false);
603
604 render_frame_host->SetNavigationHandle(nullptr); 599 render_frame_host->SetNavigationHandle(nullptr);
605 } 600 }
606 601
607 // TODO(clamy): The NavigationHandle should always be reset here.
608
609 if (!did_navigate) 602 if (!did_navigate)
610 return; // No navigation happened. 603 return; // No navigation happened.
611 604
612 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen 605 // DO NOT ADD MORE STUFF TO THIS FUNCTION! Your component should either listen
613 // for the appropriate notification (best) or you can add it to 606 // for the appropriate notification (best) or you can add it to
614 // DidNavigateMainFramePostCommit / DidNavigateAnyFramePostCommit (only if 607 // DidNavigateMainFramePostCommit / DidNavigateAnyFramePostCommit (only if
615 // necessary, please). 608 // necessary, please).
616 609
617 // TODO(carlosk): Move this out when PlzNavigate implementation properly calls 610 // TODO(carlosk): Move this out when PlzNavigate implementation properly calls
618 // the observer methods. 611 // the observer methods.
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 if (pending_entry != controller_->GetVisibleEntry() || 1128 if (pending_entry != controller_->GetVisibleEntry() ||
1136 !should_preserve_entry) { 1129 !should_preserve_entry) {
1137 controller_->DiscardPendingEntry(true); 1130 controller_->DiscardPendingEntry(true);
1138 1131
1139 // Also force the UI to refresh. 1132 // Also force the UI to refresh.
1140 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); 1133 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL);
1141 } 1134 }
1142 } 1135 }
1143 1136
1144 } // namespace content 1137 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.cc ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698