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 "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void RequestTransferURL(RenderFrameHostImpl* render_frame_host, | 63 void RequestTransferURL(RenderFrameHostImpl* render_frame_host, |
64 const GURL& url, | 64 const GURL& url, |
65 SiteInstance* source_site_instance, | 65 SiteInstance* source_site_instance, |
66 const std::vector<GURL>& redirect_chain, | 66 const std::vector<GURL>& redirect_chain, |
67 const Referrer& referrer, | 67 const Referrer& referrer, |
68 ui::PageTransition page_transition, | 68 ui::PageTransition page_transition, |
69 WindowOpenDisposition disposition, | 69 WindowOpenDisposition disposition, |
70 const GlobalRequestID& transferred_global_request_id, | 70 const GlobalRequestID& transferred_global_request_id, |
71 bool should_replace_current_entry, | 71 bool should_replace_current_entry, |
72 bool user_gesture) override; | 72 bool user_gesture) override; |
| 73 void OnBeforeUnloadACK(FrameTreeNode* frame_tree_node, bool proceed) override; |
73 void OnBeginNavigation(FrameTreeNode* frame_tree_node, | 74 void OnBeginNavigation(FrameTreeNode* frame_tree_node, |
74 const FrameHostMsg_BeginNavigation_Params& params, | 75 const CommonNavigationParams& common_params, |
75 const CommonNavigationParams& common_params) override; | 76 const BeginNavigationParams& begin_params, |
| 77 scoped_refptr<ResourceRequestBody> body) override; |
76 void CommitNavigation(FrameTreeNode* frame_tree_node, | 78 void CommitNavigation(FrameTreeNode* frame_tree_node, |
77 ResourceResponse* response, | 79 ResourceResponse* response, |
78 scoped_ptr<StreamHandle> body) override; | 80 scoped_ptr<StreamHandle> body) override; |
79 void LogResourceRequestTime(base::TimeTicks timestamp, | 81 void LogResourceRequestTime(base::TimeTicks timestamp, |
80 const GURL& url) override; | 82 const GURL& url) override; |
81 void LogBeforeUnloadTime( | 83 void LogBeforeUnloadTime( |
82 const base::TimeTicks& renderer_before_unload_start_time, | 84 const base::TimeTicks& renderer_before_unload_start_time, |
83 const base::TimeTicks& renderer_before_unload_end_time) override; | 85 const base::TimeTicks& renderer_before_unload_end_time) override; |
84 void CancelNavigation(FrameTreeNode* frame_tree_node) override; | 86 void CancelNavigation(FrameTreeNode* frame_tree_node) override; |
85 bool IsWaitingForBeforeUnloadACK(FrameTreeNode* frame_tree_node) override; | 87 bool IsWaitingForBeforeUnloadACK(FrameTreeNode* frame_tree_node) override; |
(...skipping 16 matching lines...) Expand all Loading... |
102 RenderFrameHostImpl* render_frame_host, | 104 RenderFrameHostImpl* render_frame_host, |
103 const NavigationEntryImpl& entry, | 105 const NavigationEntryImpl& entry, |
104 NavigationController::ReloadType reload_type); | 106 NavigationController::ReloadType reload_type); |
105 | 107 |
106 bool ShouldAssignSiteForURL(const GURL& url); | 108 bool ShouldAssignSiteForURL(const GURL& url); |
107 | 109 |
108 void CheckWebUIRendererDoesNotDisplayNormalURL( | 110 void CheckWebUIRendererDoesNotDisplayNormalURL( |
109 RenderFrameHostImpl* render_frame_host, | 111 RenderFrameHostImpl* render_frame_host, |
110 const GURL& url); | 112 const GURL& url); |
111 | 113 |
112 // PlzNavigate: sends a RequestNavigation IPC to the renderer to ask it to | 114 // PlzNavigate: if needed, sends a BeforeUnload IPC to the renderer to ask it |
113 // navigate. If no live renderer is present, then the navigation request will | 115 // to execute the beforeUnload event. Otherwise, the navigation request will |
114 // be sent directly to the ResourceDispatcherHost. | 116 // be started. |
115 bool RequestNavigation(FrameTreeNode* frame_tree_node, | 117 void RequestNavigation(FrameTreeNode* frame_tree_node, |
116 const NavigationEntryImpl& entry, | 118 const NavigationEntryImpl& entry, |
117 NavigationController::ReloadType reload_type, | 119 NavigationController::ReloadType reload_type, |
118 base::TimeTicks navigation_start); | 120 base::TimeTicks navigation_start); |
119 | 121 |
| 122 // PlzNavigate: sends the NavigationRequest for |frame_tree_node| to the |
| 123 // network stack so that it can start. |
| 124 void BeginNavigation(FrameTreeNode* frame_tree_node); |
| 125 |
120 void RecordNavigationMetrics( | 126 void RecordNavigationMetrics( |
121 const LoadCommittedDetails& details, | 127 const LoadCommittedDetails& details, |
122 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 128 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
123 SiteInstance* site_instance); | 129 SiteInstance* site_instance); |
124 | 130 |
125 // The NavigationController that will keep track of session history for all | 131 // The NavigationController that will keep track of session history for all |
126 // RenderFrameHost objects using this NavigatorImpl. | 132 // RenderFrameHost objects using this NavigatorImpl. |
127 // TODO(nasko): Move ownership of the NavigationController from | 133 // TODO(nasko): Move ownership of the NavigationController from |
128 // WebContentsImpl to this class. | 134 // WebContentsImpl to this class. |
129 NavigationControllerImpl* controller_; | 135 NavigationControllerImpl* controller_; |
130 | 136 |
131 // Used to notify the object embedding this Navigator about navigation | 137 // Used to notify the object embedding this Navigator about navigation |
132 // events. Can be NULL in tests. | 138 // events. Can be NULL in tests. |
133 NavigatorDelegate* delegate_; | 139 NavigatorDelegate* delegate_; |
134 | 140 |
135 scoped_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; | 141 scoped_ptr<NavigatorImpl::NavigationMetricsData> navigation_data_; |
136 | 142 |
137 // PlzNavigate: used to track the various ongoing NavigationRequests in the | 143 // PlzNavigate: used to track the various ongoing NavigationRequests in the |
138 // different FrameTreeNodes, based on the frame_tree_node_id. | 144 // different FrameTreeNodes, based on the frame_tree_node_id. |
139 typedef base::ScopedPtrHashMap<int64, NavigationRequest> NavigationRequestMap; | 145 typedef base::ScopedPtrHashMap<int64, NavigationRequest> NavigationRequestMap; |
140 NavigationRequestMap navigation_request_map_; | 146 NavigationRequestMap navigation_request_map_; |
141 | 147 |
142 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); | 148 DISALLOW_COPY_AND_ASSIGN(NavigatorImpl); |
143 }; | 149 }; |
144 | 150 |
145 } // namespace content | 151 } // namespace content |
146 | 152 |
147 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ | 153 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_IMPL_H_ |
OLD | NEW |