Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Side by Side Diff: content/browser/frame_host/navigation_handle_impl.h

Issue 2335133003: PlzNavigate: support the WebRequest API (Closed)
Patch Set: Addressed comments + changes to NavigationHandleImpl following 2364943002 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <string> 11 #include <string>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/scoped_vector.h" 16 #include "base/memory/scoped_vector.h"
17 #include "content/browser/frame_host/frame_tree_node.h" 17 #include "content/browser/frame_host/frame_tree_node.h"
18 #include "content/browser/frame_host/render_frame_host_impl.h" 18 #include "content/browser/frame_host/render_frame_host_impl.h"
19 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
20 #include "content/public/browser/navigation_data.h" 20 #include "content/public/browser/navigation_data.h"
21 #include "content/public/browser/navigation_throttle.h" 21 #include "content/public/browser/navigation_throttle.h"
22 #include "content/public/browser/ssl_status.h" 22 #include "content/public/browser/ssl_status.h"
23 #include "content/public/common/request_context_type.h" 23 #include "content/public/common/request_context_type.h"
24 #include "url/gurl.h" 24 #include "url/gurl.h"
25 25
26 struct FrameHostMsg_DidCommitProvisionalLoad_Params; 26 struct FrameHostMsg_DidCommitProvisionalLoad_Params;
27 27
28 namespace content { 28 namespace content {
29 29
30 class NavigationUIData;
30 class NavigatorDelegate; 31 class NavigatorDelegate;
31 class ResourceRequestBodyImpl; 32 class ResourceRequestBodyImpl;
32 class ServiceWorkerContextWrapper; 33 class ServiceWorkerContextWrapper;
33 class ServiceWorkerNavigationHandle; 34 class ServiceWorkerNavigationHandle;
34 35
35 // This class keeps track of a single navigation. It is created upon receipt of 36 // This class keeps track of a single navigation. It is created upon receipt of
36 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns 37 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns
37 // the newly created NavigationHandleImpl as long as the navigation is ongoing. 38 // the newly created NavigationHandleImpl as long as the navigation is ongoing.
38 // The NavigationHandleImpl in the RenderFrameHost will be reset when the 39 // The NavigationHandleImpl in the RenderFrameHost will be reset when the
39 // navigation stops, that is if one of the following events happen: 40 // navigation stops, that is if one of the following events happen:
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 245
245 // Called during commit. Takes ownership of the embedder's NavigationData 246 // Called during commit. Takes ownership of the embedder's NavigationData
246 // instance. This NavigationData may have been cloned prior to being added 247 // instance. This NavigationData may have been cloned prior to being added
247 // here. 248 // here.
248 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { 249 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) {
249 navigation_data_ = std::move(navigation_data); 250 navigation_data_ = std::move(navigation_data);
250 } 251 }
251 252
252 SSLStatus ssl_status() { return ssl_status_; } 253 SSLStatus ssl_status() { return ssl_status_; }
253 254
255 NavigationUIData* navigation_ui_data() const {
256 return navigation_ui_data_.get();
257 }
258
254 private: 259 private:
255 friend class NavigationHandleImplTest; 260 friend class NavigationHandleImplTest;
256 261
257 // Used to track the state the navigation is currently in. 262 // Used to track the state the navigation is currently in.
258 enum State { 263 enum State {
259 INITIAL = 0, 264 INITIAL = 0,
260 WILL_SEND_REQUEST, 265 WILL_SEND_REQUEST,
261 DEFERRING_START, 266 DEFERRING_START,
262 WILL_REDIRECT_REQUEST, 267 WILL_REDIRECT_REQUEST,
263 DEFERRING_REDIRECT, 268 DEFERRING_REDIRECT,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 RequestContextType request_context_type_; 345 RequestContextType request_context_type_;
341 346
342 // This callback will be run when all throttle checks have been performed. 347 // This callback will be run when all throttle checks have been performed.
343 ThrottleChecksFinishedCallback complete_callback_; 348 ThrottleChecksFinishedCallback complete_callback_;
344 349
345 // PlzNavigate 350 // PlzNavigate
346 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a 351 // Manages the lifetime of a pre-created ServiceWorkerProviderHost until a
347 // corresponding ServiceWorkerNetworkProvider is created in the renderer. 352 // corresponding ServiceWorkerNetworkProvider is created in the renderer.
348 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_; 353 std::unique_ptr<ServiceWorkerNavigationHandle> service_worker_handle_;
349 354
350 // Embedder data tied to this navigation. 355 // Embedder data from the IO thread tied to this navigation.
351 std::unique_ptr<NavigationData> navigation_data_; 356 std::unique_ptr<NavigationData> navigation_data_;
352 357
358 // PlzNavigate
359 // Embedder data from the UI thread tied to this navigation.
360 std::unique_ptr<NavigationUIData> navigation_ui_data_;
361
353 SSLStatus ssl_status_; 362 SSLStatus ssl_status_;
354 363
355 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 364 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
356 }; 365 };
357 366
358 } // namespace content 367 } // namespace content
359 368
360 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 369 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698