OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NAVIGATION_HANDLE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
7 | 7 |
8 #include "content/public/browser/navigation_handle.h" | 8 #include "content/public/browser/navigation_handle.h" |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
16 #include "content/browser/frame_host/frame_tree_node.h" | 16 #include "content/browser/frame_host/frame_tree_node.h" |
17 #include "content/browser/frame_host/render_frame_host_impl.h" | 17 #include "content/browser/frame_host/render_frame_host_impl.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 #include "content/public/browser/navigation_data.h" | 19 #include "content/public/browser/navigation_data.h" |
20 #include "content/public/browser/navigation_throttle.h" | 20 #include "content/public/browser/navigation_throttle.h" |
21 #include "content/public/common/request_context_type.h" | 21 #include "content/public/common/request_context_type.h" |
| 22 #include "content/public/common/ssl_status.h" |
22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
23 | 24 |
24 struct FrameHostMsg_DidCommitProvisionalLoad_Params; | 25 struct FrameHostMsg_DidCommitProvisionalLoad_Params; |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 | 28 |
28 class NavigatorDelegate; | 29 class NavigatorDelegate; |
29 class ResourceRequestBodyImpl; | 30 class ResourceRequestBodyImpl; |
30 | 31 |
31 // This class keeps track of a single navigation. It is created upon receipt of | 32 // This class keeps track of a single navigation. It is created upon receipt of |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // Called when the URLRequest has delivered response headers and metadata. | 195 // Called when the URLRequest has delivered response headers and metadata. |
195 // |callback| will be called when all throttle checks have completed, | 196 // |callback| will be called when all throttle checks have completed, |
196 // allowing the caller to cancel the navigation or let it proceed. | 197 // allowing the caller to cancel the navigation or let it proceed. |
197 // NavigationHandle will not call |callback| with a result of DEFER. | 198 // NavigationHandle will not call |callback| with a result of DEFER. |
198 // If the result is PROCEED, then 'ReadyToCommitNavigation' will be called | 199 // If the result is PROCEED, then 'ReadyToCommitNavigation' will be called |
199 // with |render_frame_host| and |response_headers| just before calling | 200 // with |render_frame_host| and |response_headers| just before calling |
200 // |callback|. | 201 // |callback|. |
201 void WillProcessResponse( | 202 void WillProcessResponse( |
202 RenderFrameHostImpl* render_frame_host, | 203 RenderFrameHostImpl* render_frame_host, |
203 scoped_refptr<net::HttpResponseHeaders> response_headers, | 204 scoped_refptr<net::HttpResponseHeaders> response_headers, |
| 205 const SSLStatus& ssl_status, |
204 const ThrottleChecksFinishedCallback& callback); | 206 const ThrottleChecksFinishedCallback& callback); |
205 | 207 |
206 // Returns the FrameTreeNode this navigation is happening in. | 208 // Returns the FrameTreeNode this navigation is happening in. |
207 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } | 209 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } |
208 | 210 |
209 // Called when the navigation is ready to be committed in | 211 // Called when the navigation is ready to be committed in |
210 // |render_frame_host|. This will update the |state_| and inform the | 212 // |render_frame_host|. This will update the |state_| and inform the |
211 // delegate. | 213 // delegate. |
212 void ReadyToCommitNavigation(RenderFrameHostImpl* render_frame_host); | 214 void ReadyToCommitNavigation(RenderFrameHostImpl* render_frame_host); |
213 | 215 |
214 // Called when the navigation was committed in |render_frame_host|. This will | 216 // Called when the navigation was committed in |render_frame_host|. This will |
215 // update the |state_|. | 217 // update the |state_|. |
216 void DidCommitNavigation( | 218 void DidCommitNavigation( |
217 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 219 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
218 bool same_page, | 220 bool same_page, |
219 RenderFrameHostImpl* render_frame_host); | 221 RenderFrameHostImpl* render_frame_host); |
220 | 222 |
| 223 // This is only used for the non-PlzNavigate case, as it's the one that has |
| 224 // cross-site requests being transferred to new processes. When that occurs, |
| 225 // the SSL certificate ID has to be updated. |
| 226 void UpdateSSLCertId(int new_cert_id); |
| 227 |
221 // Called during commit. Takes ownership of the embedder's NavigationData | 228 // Called during commit. Takes ownership of the embedder's NavigationData |
222 // instance. This NavigationData may have been cloned prior to being added | 229 // instance. This NavigationData may have been cloned prior to being added |
223 // here. | 230 // here. |
224 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { | 231 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { |
225 navigation_data_ = std::move(navigation_data); | 232 navigation_data_ = std::move(navigation_data); |
226 } | 233 } |
227 | 234 |
| 235 SSLStatus ssl_status() { return ssl_status_; } |
| 236 |
228 private: | 237 private: |
229 friend class NavigationHandleImplTest; | 238 friend class NavigationHandleImplTest; |
230 | 239 |
231 // Used to track the state the navigation is currently in. | 240 // Used to track the state the navigation is currently in. |
232 enum State { | 241 enum State { |
233 INITIAL = 0, | 242 INITIAL = 0, |
234 WILL_SEND_REQUEST, | 243 WILL_SEND_REQUEST, |
235 DEFERRING_START, | 244 DEFERRING_START, |
236 WILL_REDIRECT_REQUEST, | 245 WILL_REDIRECT_REQUEST, |
237 DEFERRING_REDIRECT, | 246 DEFERRING_REDIRECT, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 321 |
313 // The fetch request context type. | 322 // The fetch request context type. |
314 RequestContextType request_context_type_; | 323 RequestContextType request_context_type_; |
315 | 324 |
316 // This callback will be run when all throttle checks have been performed. | 325 // This callback will be run when all throttle checks have been performed. |
317 ThrottleChecksFinishedCallback complete_callback_; | 326 ThrottleChecksFinishedCallback complete_callback_; |
318 | 327 |
319 // Embedder data tied to this navigation. | 328 // Embedder data tied to this navigation. |
320 std::unique_ptr<NavigationData> navigation_data_; | 329 std::unique_ptr<NavigationData> navigation_data_; |
321 | 330 |
| 331 SSLStatus ssl_status_; |
| 332 |
322 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); | 333 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); |
323 }; | 334 }; |
324 | 335 |
325 } // namespace content | 336 } // namespace content |
326 | 337 |
327 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ | 338 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ |
OLD | NEW |