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

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

Issue 2335133003: PlzNavigate: support the WebRequest API (Closed)
Patch Set: Added missing comment Created 4 years, 3 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 33
33 // This class keeps track of a single navigation. It is created upon receipt of 34 // This class keeps track of a single navigation. It is created upon receipt of
34 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns 35 // a DidStartProvisionalLoad IPC in a RenderFrameHost. The RenderFrameHost owns
35 // the newly created NavigationHandleImpl as long as the navigation is ongoing. 36 // the newly created NavigationHandleImpl as long as the navigation is ongoing.
36 // The NavigationHandleImpl in the RenderFrameHost will be reset when the 37 // The NavigationHandleImpl in the RenderFrameHost will be reset when the
37 // navigation stops, that is if one of the following events happen: 38 // navigation stops, that is if one of the following events happen:
38 // - The RenderFrameHost receives a DidStartProvisionalLoad IPC for a new 39 // - The RenderFrameHost receives a DidStartProvisionalLoad IPC for a new
39 // navigation (see below for special cases where the DidStartProvisionalLoad 40 // navigation (see below for special cases where the DidStartProvisionalLoad
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 226
226 // Called during commit. Takes ownership of the embedder's NavigationData 227 // Called during commit. Takes ownership of the embedder's NavigationData
227 // instance. This NavigationData may have been cloned prior to being added 228 // instance. This NavigationData may have been cloned prior to being added
228 // here. 229 // here.
229 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { 230 void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) {
230 navigation_data_ = std::move(navigation_data); 231 navigation_data_ = std::move(navigation_data);
231 } 232 }
232 233
233 SSLStatus ssl_status() { return ssl_status_; } 234 SSLStatus ssl_status() { return ssl_status_; }
234 235
236 NavigationUIData* navigation_ui_data() const {
237 return navigation_ui_data_.get();
238 }
239
235 private: 240 private:
236 friend class NavigationHandleImplTest; 241 friend class NavigationHandleImplTest;
237 242
238 // Used to track the state the navigation is currently in. 243 // Used to track the state the navigation is currently in.
239 enum State { 244 enum State {
240 INITIAL = 0, 245 INITIAL = 0,
241 WILL_SEND_REQUEST, 246 WILL_SEND_REQUEST,
242 DEFERRING_START, 247 DEFERRING_START,
243 WILL_REDIRECT_REQUEST, 248 WILL_REDIRECT_REQUEST,
244 DEFERRING_REDIRECT, 249 DEFERRING_REDIRECT,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 321
317 // The unique id of the corresponding NavigationEntry. 322 // The unique id of the corresponding NavigationEntry.
318 int pending_nav_entry_id_; 323 int pending_nav_entry_id_;
319 324
320 // The fetch request context type. 325 // The fetch request context type.
321 RequestContextType request_context_type_; 326 RequestContextType request_context_type_;
322 327
323 // This callback will be run when all throttle checks have been performed. 328 // This callback will be run when all throttle checks have been performed.
324 ThrottleChecksFinishedCallback complete_callback_; 329 ThrottleChecksFinishedCallback complete_callback_;
325 330
326 // Embedder data tied to this navigation. 331 // Embedder data from the IO thread tied to this navigation.
327 std::unique_ptr<NavigationData> navigation_data_; 332 std::unique_ptr<NavigationData> navigation_data_;
328 333
329 SSLStatus ssl_status_; 334 SSLStatus ssl_status_;
330 335
336 // PlzNavigate
337 // Embedder data from the UI thread tied to this navigation.
338 std::unique_ptr<NavigationUIData> navigation_ui_data_;
nasko 2016/09/22 18:32:50 nit: Let's put this closer to the IO thread one, S
clamy 2016/09/26 15:37:51 Done.
339
331 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl); 340 DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
332 }; 341 };
333 342
334 } // namespace content 343 } // namespace content
335 344
336 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_ 345 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_HANDLE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698