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

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

Issue 483773002: PlzNavigate: implement CommitNavigation on the browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a class to keep track of navigation parameters Created 6 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_PARAMETERS_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_PARAMETERS_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/time/time.h"
12 #include "content/common/frame_message_enums.h"
13 #include "content/public/common/page_state.h"
14 #include "content/public/common/page_transition_types.h"
15 #include "content/public/common/referrer.h"
16 #include "url/gurl.h"
17 struct FrameHostMsg_BeginNavigation_Params;
18 struct FrameMsg_CommitNavigation_Params;
19
20 namespace content {
21 class NavigationControllerImpl;
22 class NavigationEntryImpl;
23 struct NavigationBeforeCommitInfo;
24
25 // PlzNavigate
26 // This class holds parameters for a Navigation. It is first created when the
(Do not use) nasko 2014/09/05 17:04:48 nit: "navigation", no need to uppercase.
27 // the navigation is requested, then updated when the navigation begins and when
(Do not use) nasko 2014/09/05 17:04:48 In the case of renderer initiated, there will be n
28 // the navigation is ready to commit.
29 class NavigationParameters {
clamy 2014/09/03 22:23:44 Disclaimer: if you have a great name for that clas
(Do not use) nasko 2014/09/05 17:04:48 I don't have anything greater than what you've alr
30 public:
31 NavigationParameters(const NavigationEntryImpl& entry,
32 NavigationControllerImpl* controller,
33 base::TimeTicks navigation_start,
34 FrameMsg_Navigate_Type::Value navigation_type);
35 ~NavigationParameters();
36
37 bool allow_download() const { return allow_download_; }
38 FrameMsg_Navigate_Type::Value navigation_type_for_testing() const {
39 return navigation_type_;
40 }
41
42 void UpdateFromBeginNavigationParams(
(Do not use) nasko 2014/09/05 17:04:48 nit: I'd drop the "Params" part of the name, it is
43 const FrameHostMsg_BeginNavigation_Params& begin_navigation_params);
44 void UpdateFromCommitInfo(const NavigationBeforeCommitInfo& commit_info);
45
46 // Simulates the response from the renderer when there is no live renderer.
47 FrameHostMsg_BeginNavigation_Params SimulateRendererResponse() const;
(Do not use) nasko 2014/09/05 17:04:48 Is this intended for tests? Or temporary? It shoul
48
49 FrameMsg_CommitNavigation_Params MakeCommitNavigationParams() const;
50
51 private:
52 // The URL to navigate to. May be modified when th enavigation is ready to
(Do not use) nasko 2014/09/05 17:04:48 "the navigation"
53 // commit.
54 GURL url_;
55
56 // The URL to request to the browser to get access to the stream of data.
(Do not use) nasko 2014/09/05 17:04:48 nit: "The URL the renderer should request from the
57 GURL stream_url_;
58
59 bool is_post_;
(Do not use) nasko 2014/09/05 17:04:48 comment?
60
61 // The page_id for this navigation, or -1 if it is a new navigation. Back,
62 // Forward, and Reload navigations should have a valid page_id. If the load
63 // succeeds, then this page_id will be reflected in the resultant
64 // FrameHostMsg_DidCommitProvisionalLoad message.
65 int32 page_id_;
66
67 // Informs the RenderView the session history should be cleared. In that
(Do not use) nasko 2014/09/05 17:04:48 nit: Let's start using RenderFrame in all new code
68 // case, the RenderView needs to notify the browser that the clearing was
69 // succesful when the navigation commits.
70 bool should_clear_history_list_;
71
72 // If page_id is -1, then pending_history_list_offset will also be -1.
73 // Otherwise, it contains the offset into the history list corresponding to
74 // the current navigation.
75 int pending_history_list_offset_;
76
77 // Used to inform the RenderView of where its current page contents reside in
78 // session history and the total size of the session history list.
79 int current_history_list_offset_;
80 int current_history_list_length_;
81
82 // The URL to send in the "Referer" header field. Can be empty if there is
83 // no referrer.
84 Referrer referrer_;
85
86 // The type of transition.
87 PageTransition transition_;
88
89 // Opaque history state (received by ViewHostMsg_UpdateState).
90 PageState page_state_;
91
92 // Type of navigation.
93 FrameMsg_Navigate_Type::Value navigation_type_;
94
95 // Whether or not the user agent override string should be used.
96 bool is_overriding_user_agent_;
97
98 // Whether this navigation should replace the current session history entry on
99 // commit.
100 bool should_replace_current_entry_;
101
102 // Whether or not we should allow the URL to download.
103 bool allow_download_;
104
105 // The navigationStart time to expose through the Navigation Timing API to JS.
106 base::TimeTicks browser_navigation_start_;
(Do not use) nasko 2014/09/05 17:04:48 This is mostly a copy of FrameMsg_Navigate_Params.
clamy 2014/09/05 18:21:25 So if we split up the IPCs in having some sort of
107 };
108
109 } // namespace content
110
111 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_PARAMETERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698