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..9f29e553ea797722de94db4e8d4a1d4cc8c0f32b 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 |
@@ -176,14 +184,6 @@ class CONTENT_EXPORT Navigator : public base::RefCounted<Navigator> { |
const base::TimeTicks& renderer_before_unload_start_time, |
const base::TimeTicks& renderer_before_unload_end_time) {} |
- // Returns the NavigationHandle associated with a navigation in |
- // |render_frame_host|. Normally, each frame can have its own |
- // NavigationHandle. However, in the case of a navigation to an interstitial |
- // page, there's just one NavigationHandle for the whole page (since it's |
- // assumed to only have one RenderFrameHost and navigate once). |
- virtual NavigationHandleImpl* GetNavigationHandleForFrameHost( |
- RenderFrameHostImpl* render_frame_host); |
- |
// Called when a navigation has failed or the response is 204/205 to discard |
// the pending entry in order to avoid url spoofs. |
virtual void DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) {} |