| OLD | NEW |
| 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 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 bool has_stale_copy_in_cache, | 90 bool has_stale_copy_in_cache, |
| 91 int error_code) override; | 91 int error_code) override; |
| 92 void LogResourceRequestTime(base::TimeTicks timestamp, | 92 void LogResourceRequestTime(base::TimeTicks timestamp, |
| 93 const GURL& url) override; | 93 const GURL& url) override; |
| 94 void LogBeforeUnloadTime( | 94 void LogBeforeUnloadTime( |
| 95 const base::TimeTicks& renderer_before_unload_start_time, | 95 const base::TimeTicks& renderer_before_unload_start_time, |
| 96 const base::TimeTicks& renderer_before_unload_end_time) override; | 96 const base::TimeTicks& renderer_before_unload_end_time) override; |
| 97 void CancelNavigation(FrameTreeNode* frame_tree_node) override; | 97 void CancelNavigation(FrameTreeNode* frame_tree_node) override; |
| 98 NavigationHandleImpl* GetNavigationHandleForFrameHost( | 98 NavigationHandleImpl* GetNavigationHandleForFrameHost( |
| 99 RenderFrameHostImpl* render_frame_host) override; | 99 RenderFrameHostImpl* render_frame_host) override; |
| 100 void DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) override; |
| 100 | 101 |
| 101 private: | 102 private: |
| 102 // Holds data used to track browser side navigation metrics. | 103 // Holds data used to track browser side navigation metrics. |
| 103 struct NavigationMetricsData; | 104 struct NavigationMetricsData; |
| 104 | 105 |
| 105 friend class NavigatorTestWithBrowserSideNavigation; | 106 friend class NavigatorTestWithBrowserSideNavigation; |
| 106 ~NavigatorImpl() override; | 107 ~NavigatorImpl() override; |
| 107 | 108 |
| 108 // Navigates to the given entry, which might be the pending entry (if | 109 // Navigates to the given entry, which might be the pending entry (if |
| 109 // |is_pending_entry| is true). Private because all callers should use either | 110 // |is_pending_entry| is true). Private because all callers should use either |
| (...skipping 28 matching lines...) Expand all Loading... |
| 138 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 139 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| 139 SiteInstance* site_instance); | 140 SiteInstance* site_instance); |
| 140 | 141 |
| 141 // Called when a navigation has started in a main frame, to update the pending | 142 // Called when a navigation has started in a main frame, to update the pending |
| 142 // NavigationEntry if the controller does not currently have a | 143 // NavigationEntry if the controller does not currently have a |
| 143 // browser-initiated one. | 144 // browser-initiated one. |
| 144 void DidStartMainFrameNavigation(const GURL& url, | 145 void DidStartMainFrameNavigation(const GURL& url, |
| 145 SiteInstanceImpl* site_instance, | 146 SiteInstanceImpl* site_instance, |
| 146 NavigationHandleImpl* navigation_handle); | 147 NavigationHandleImpl* navigation_handle); |
| 147 | 148 |
| 148 // Called when a navigation has failed to discard the pending entry in order | |
| 149 // to avoid url spoofs. | |
| 150 void DiscardPendingEntryOnFailureIfNeeded(NavigationHandleImpl* handle); | |
| 151 | |
| 152 // The NavigationController that will keep track of session history for all | 149 // The NavigationController that will keep track of session history for all |
| 153 // RenderFrameHost objects using this NavigatorImpl. | 150 // RenderFrameHost objects using this NavigatorImpl. |
| 154 // TODO(nasko): Move ownership of the NavigationController from | 151 // TODO(nasko): Move ownership of the NavigationController from |
| 155 // WebContentsImpl to this class. | 152 // WebContentsImpl to this class. |
| 156 NavigationControllerImpl* controller_; | 153 NavigationControllerImpl* controller_; |
| 157 | 154 |
| 158 // Used to notify the object embedding this Navigator about navigation | 155 // Used to notify the object embedding this Navigator about navigation |
| 159 // events. Can be NULL in tests. | 156 // events. Can be NULL in tests. |
| 160 NavigatorDelegate* delegate_; | 157 NavigatorDelegate* delegate_; |
| 161 | 158 |
| 162 std::unique_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; | 159 std::unique_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; |
| 163 | 160 |
| 164 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 161 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
| 165 }; | 162 }; |
| 166 | 163 |
| 167 } // namespace content | 164 } // namespace content |
| 168 | 165 |
| 169 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 166 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
| OLD | NEW |