| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 const std::string& method, | 141 const std::string& method, |
| 142 scoped_refptr<ResourceRequestBodyImpl> post_body, | 142 scoped_refptr<ResourceRequestBodyImpl> post_body, |
| 143 const std::string& extra_headers) {} | 143 const std::string& extra_headers) {} |
| 144 | 144 |
| 145 // PlzNavigate | 145 // PlzNavigate |
| 146 // Called after receiving a BeforeUnloadACK IPC from the renderer. If | 146 // Called after receiving a BeforeUnloadACK IPC from the renderer. If |
| 147 // |frame_tree_node| has a NavigationRequest waiting for the renderer | 147 // |frame_tree_node| has a NavigationRequest waiting for the renderer |
| 148 // response, then the request is either started or canceled, depending on the | 148 // response, then the request is either started or canceled, depending on the |
| 149 // value of |proceed|. | 149 // value of |proceed|. |
| 150 virtual void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, | 150 virtual void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, |
| 151 bool proceed) {} | 151 bool proceed, |
| 152 const base::TimeTicks& proceed_time) {} |
| 152 | 153 |
| 153 // PlzNavigate | 154 // PlzNavigate |
| 154 // Used to start a new renderer-initiated navigation, following a | 155 // Used to start a new renderer-initiated navigation, following a |
| 155 // BeginNavigation IPC from the renderer. | 156 // BeginNavigation IPC from the renderer. |
| 156 virtual void OnBeginNavigation(FrameTreeNode* frame_tree_node, | 157 virtual void OnBeginNavigation(FrameTreeNode* frame_tree_node, |
| 157 const CommonNavigationParams& common_params, | 158 const CommonNavigationParams& common_params, |
| 158 const BeginNavigationParams& begin_params); | 159 const BeginNavigationParams& begin_params); |
| 159 | 160 |
| 160 // PlzNavigate | 161 // PlzNavigate |
| 161 // Used to abort an ongoing renderer-initiated navigation. | 162 // Used to abort an ongoing renderer-initiated navigation. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 178 virtual void LogResourceRequestTime( | 179 virtual void LogResourceRequestTime( |
| 179 base::TimeTicks timestamp, const GURL& url) {}; | 180 base::TimeTicks timestamp, const GURL& url) {}; |
| 180 | 181 |
| 181 // Called to record the time it took to execute the before unload hook for the | 182 // Called to record the time it took to execute the before unload hook for the |
| 182 // current navigation. | 183 // current navigation. |
| 183 virtual void LogBeforeUnloadTime( | 184 virtual void LogBeforeUnloadTime( |
| 184 const base::TimeTicks& renderer_before_unload_start_time, | 185 const base::TimeTicks& renderer_before_unload_start_time, |
| 185 const base::TimeTicks& renderer_before_unload_end_time) {} | 186 const base::TimeTicks& renderer_before_unload_end_time) {} |
| 186 | 187 |
| 187 // Called when a navigation has failed or the response is 204/205 to discard | 188 // Called when a navigation has failed or the response is 204/205 to discard |
| 188 // the pending entry in order to avoid url spoofs. | 189 // the pending entry in order to avoid url spoofs. |expected_pending_entry_id| |
| 189 virtual void DiscardPendingEntryIfNeeded(NavigationHandleImpl* handle) {} | 190 // is the ID of the pending NavigationEntry at the start of the navigation. |
| 191 // With sufficiently bad interleaving of IPCs, this may no longer be the |
| 192 // pending NavigationEntry, in which case the pending NavigationEntry will not |
| 193 // be discarded. |
| 194 virtual void DiscardPendingEntryIfNeeded(int expected_pending_entry_id) {} |
| 190 | 195 |
| 191 protected: | 196 protected: |
| 192 friend class base::RefCounted<Navigator>; | 197 friend class base::RefCounted<Navigator>; |
| 193 virtual ~Navigator() {} | 198 virtual ~Navigator() {} |
| 194 }; | 199 }; |
| 195 | 200 |
| 196 } // namespace content | 201 } // namespace content |
| 197 | 202 |
| 198 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ | 203 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_H_ |
| OLD | NEW |