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

Unified Diff: content/browser/frame_host/navigator.h

Issue 2475693002: Do not reset NavigationHandle when navigating same-page (Closed)
Patch Set: Rebase Created 4 years, 1 month 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/navigator.h
diff --git a/content/browser/frame_host/navigator.h b/content/browser/frame_host/navigator.h
index 6ad75ed24cd87a572c67df2651d401b5d162bc75..906f92119b03c4be05da27d01a6a2894ee3cc507 100644
--- a/content/browser/frame_host/navigator.h
+++ b/content/browser/frame_host/navigator.h
@@ -7,6 +7,7 @@
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
+#include "content/browser/frame_host/navigation_handle_impl.h"
#include "content/browser/frame_host/navigator_delegate.h"
#include "content/common/content_export.h"
#include "content/public/browser/navigation_controller.h"
@@ -24,7 +25,6 @@ namespace content {
class FrameNavigationEntry;
class FrameTreeNode;
-class NavigationHandleImpl;
class NavigationRequest;
class RenderFrameHostImpl;
class ResourceRequestBodyImpl;
@@ -67,10 +67,18 @@ class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> {
const base::string16& error_description,
bool was_ignored_by_handler) {}
- // The RenderFrameHostImpl has committed a navigation.
+ // The RenderFrameHostImpl has committed a navigation. The Navigator is
+ // responsible for resetting |navigation_handle| at the end of this method and
+ // should not attempt to keep it alive.
+ // Note: it is possible that |navigation_handle| is not the NavigationHandle
+ // stored in the RenderFrameHost that just committed. This happens for example
+ // when a same-page navigation commits while another navigation is ongoing.
+ // The Navigator should use the NavigationHandle provided by this method and
+ // not attempt to access the RenderFrameHost's NavigationsHandle.
virtual void DidNavigate(
RenderFrameHostImpl* render_frame_host,
- const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {}
+ const FrameHostMsg_DidCommitProvisionalLoad_Params& params,
+ std::unique_ptr<NavigationHandleImpl> navigation_handle) {}
// Called by the NavigationController to cause the Navigator to navigate
// to the current pending entry. The NavigationController should be called

Powered by Google App Engine
This is Rietveld 408576698