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_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/browser/frame_host/navigation_handle_impl.h" | 10 #include "content/browser/frame_host/navigation_handle_impl.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 bool proceed) {} | 150 bool proceed) {} |
151 | 151 |
152 // PlzNavigate | 152 // PlzNavigate |
153 // Used to start a new renderer-initiated navigation, following a | 153 // Used to start a new renderer-initiated navigation, following a |
154 // BeginNavigation IPC from the renderer. | 154 // BeginNavigation IPC from the renderer. |
155 virtual void OnBeginNavigation(FrameTreeNode* frame_tree_node, | 155 virtual void OnBeginNavigation(FrameTreeNode* frame_tree_node, |
156 const CommonNavigationParams& common_params, | 156 const CommonNavigationParams& common_params, |
157 const BeginNavigationParams& begin_params); | 157 const BeginNavigationParams& begin_params); |
158 | 158 |
159 // PlzNavigate | 159 // PlzNavigate |
160 // Cancel a NavigationRequest for |frame_tree_node|. Called when | 160 // Used to abort an ongoing renderer-initiated navigation. |
161 // |frame_tree_node| is destroyed. | 161 virtual void OnAbortNavigation(FrameTreeNode* frame_tree_node) {} |
162 virtual void CancelNavigation(FrameTreeNode* frame_tree_node) {} | 162 |
| 163 // PlzNavigate |
| 164 // Cancel a NavigationRequest for |frame_tree_node|. If the request is |
| 165 // renderer-initiated and |inform_renderer| is true, an IPC will be sent to |
| 166 // the renderer process to inform it that the navigation it requested was |
| 167 // cancelled. |
| 168 virtual void CancelNavigation(FrameTreeNode* frame_tree_node, |
| 169 bool inform_renderer) {} |
163 | 170 |
164 // Called when the network stack started handling the navigation request | 171 // Called when the network stack started handling the navigation request |
165 // so that the |timestamp| when it happened can be recorded into an histogram. | 172 // so that the |timestamp| when it happened can be recorded into an histogram. |
166 // The |url| is used to verify we're tracking the correct navigation. | 173 // The |url| is used to verify we're tracking the correct navigation. |
167 // TODO(carlosk): once PlzNavigate is the only navigation implementation | 174 // TODO(carlosk): once PlzNavigate is the only navigation implementation |
168 // remove the URL parameter and rename this method to better suit its naming | 175 // remove the URL parameter and rename this method to better suit its naming |
169 // conventions. | 176 // conventions. |
170 virtual void LogResourceRequestTime( | 177 virtual void LogResourceRequestTime( |
171 base::TimeTicks timestamp, const GURL& url) {}; | 178 base::TimeTicks timestamp, const GURL& url) {}; |
172 | 179 |
173 // Called to record the time it took to execute the before unload hook for the | 180 // Called to record the time it took to execute the before unload hook for the |
174 // current navigation. | 181 // current navigation. |
175 virtual void LogBeforeUnloadTime( | 182 virtual void LogBeforeUnloadTime( |
176 const base::TimeTicks& renderer_before_unload_start_time, | 183 const base::TimeTicks& renderer_before_unload_start_time, |
177 const base::TimeTicks& renderer_before_unload_end_time) {} | 184 const base::TimeTicks& renderer_before_unload_end_time) {} |
178 | 185 |
179 // Called when a navigation has failed or the response is 204/205 to discard | 186 // Called when a navigation has failed or the response is 204/205 to discard |
180 // the pending entry in order to avoid url spoofs. | 187 // the pending entry in order to avoid url spoofs. |
181 virtual void DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) {} | 188 virtual void DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) {} |
182 | 189 |
183 protected: | 190 protected: |
184 friend class base::RefCounted<Navigator>; | 191 friend class base::RefCounted<Navigator>; |
185 virtual ~Navigator() {} | 192 virtual ~Navigator() {} |
186 }; | 193 }; |
187 | 194 |
188 } // namespace content | 195 } // namespace content |
189 | 196 |
190 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 197 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
OLD | NEW |