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

Side by Side Diff: content/common/navigation_params.h

Issue 1294243004: PlzNavigate: Make ServiceWorker work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 2014 The Chromium Authors. All rights reserved. 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 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_COMMON_NAVIGATION_PARAMS_H_ 5 #ifndef CONTENT_COMMON_NAVIGATION_PARAMS_H_
6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ 6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/common/frame_message_enums.h" 13 #include "content/common/frame_message_enums.h"
14 #include "content/common/service_worker/service_worker_types.h"
14 #include "content/public/common/page_state.h" 15 #include "content/public/common/page_state.h"
15 #include "content/public/common/referrer.h" 16 #include "content/public/common/referrer.h"
17 #include "content/public/common/request_context_frame_type.h"
18 #include "content/public/common/request_context_type.h"
16 #include "ui/base/page_transition_types.h" 19 #include "ui/base/page_transition_types.h"
17 #include "url/gurl.h" 20 #include "url/gurl.h"
18 21
19 namespace base { 22 namespace base {
20 class RefCountedMemory; 23 class RefCountedMemory;
21 } 24 }
22 25
23 namespace content { 26 namespace content {
24 27
25 // PlzNavigate 28 // PlzNavigate
(...skipping 13 matching lines...) Expand all
39 CommonNavigationParams(); 42 CommonNavigationParams();
40 CommonNavigationParams(const GURL& url, 43 CommonNavigationParams(const GURL& url,
41 const Referrer& referrer, 44 const Referrer& referrer,
42 ui::PageTransition transition, 45 ui::PageTransition transition,
43 FrameMsg_Navigate_Type::Value navigation_type, 46 FrameMsg_Navigate_Type::Value navigation_type,
44 bool allow_download, 47 bool allow_download,
45 bool should_replace_current_entry, 48 bool should_replace_current_entry,
46 base::TimeTicks ui_timestamp, 49 base::TimeTicks ui_timestamp,
47 FrameMsg_UILoadMetricsReportType::Value report_type, 50 FrameMsg_UILoadMetricsReportType::Value report_type,
48 const GURL& base_url_for_data_url, 51 const GURL& base_url_for_data_url,
49 const GURL& history_url_for_data_url); 52 const GURL& history_url_for_data_url,
53 int service_worker_provider_id);
50 ~CommonNavigationParams(); 54 ~CommonNavigationParams();
51 55
52 // The URL to navigate to. 56 // The URL to navigate to.
53 // PlzNavigate: May be modified when the navigation is ready to commit. 57 // PlzNavigate: May be modified when the navigation is ready to commit.
54 GURL url; 58 GURL url;
55 59
56 // The URL to send in the "Referer" header field. Can be empty if there is 60 // The URL to send in the "Referer" header field. Can be empty if there is
57 // no referrer. 61 // no referrer.
58 Referrer referrer; 62 Referrer referrer;
59 63
(...skipping 22 matching lines...) Expand all
82 // The report type to be used when recording the metric using |ui_timestamp|. 86 // The report type to be used when recording the metric using |ui_timestamp|.
83 FrameMsg_UILoadMetricsReportType::Value report_type; 87 FrameMsg_UILoadMetricsReportType::Value report_type;
84 88
85 // Base URL for use in Blink's SubstituteData. 89 // Base URL for use in Blink's SubstituteData.
86 // Is only used with data: URLs. 90 // Is only used with data: URLs.
87 GURL base_url_for_data_url; 91 GURL base_url_for_data_url;
88 92
89 // History URL for use in Blink's SubstituteData. 93 // History URL for use in Blink's SubstituteData.
90 // Is only used with data: URLs. 94 // Is only used with data: URLs.
91 GURL history_url_for_data_url; 95 GURL history_url_for_data_url;
96
97 // PlzNavigate
98 // The ServiceWorker provider ID associated with the navigation.
99 int service_worker_provider_id;
92 }; 100 };
93 101
94 // Provided by the renderer ---------------------------------------------------- 102 // Provided by the renderer ----------------------------------------------------
95 // 103 //
96 // This struct holds parameters sent by the renderer to the browser. It is only 104 // This struct holds parameters sent by the renderer to the browser. It is only
97 // used in PlzNavigate (since in the current architecture, the renderer does not 105 // used in PlzNavigate (since in the current architecture, the renderer does not
98 // inform the browser of navigations until they commit). 106 // inform the browser of navigations until they commit).
99 107
100 // This struct is not used outside of the PlzNavigate project. 108 // This struct is not used outside of the PlzNavigate project.
101 // PlzNavigate: parameters needed to start a navigation on the IO thread, 109 // PlzNavigate: parameters needed to start a navigation on the IO thread,
102 // following a renderer-initiated navigation request. 110 // following a renderer-initiated navigation request.
103 struct CONTENT_EXPORT BeginNavigationParams { 111 struct CONTENT_EXPORT BeginNavigationParams {
104 // TODO(clamy): See if it is possible to reuse this in 112 // TODO(clamy): See if it is possible to reuse this in
105 // ResourceMsg_Request_Params. 113 // ResourceMsg_Request_Params.
106 BeginNavigationParams(); 114 BeginNavigationParams();
107 BeginNavigationParams(std::string method, 115 BeginNavigationParams(std::string method,
108 std::string headers, 116 std::string headers,
109 int load_flags, 117 int load_flags,
110 bool has_user_gesture); 118 bool has_user_gesture,
119 bool skip_service_worker,
120 RequestContextType request_context_type,
121 RequestContextFrameType frame_type);
111 122
112 // The request method: GET, POST, etc. 123 // The request method: GET, POST, etc.
113 std::string method; 124 std::string method;
114 125
115 // Additional HTTP request headers. 126 // Additional HTTP request headers.
116 std::string headers; 127 std::string headers;
117 128
118 // net::URLRequest load flags (net::LOAD_NORMAL) by default). 129 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
119 int load_flags; 130 int load_flags;
120 131
121 // True if the request was user initiated. 132 // True if the request was user initiated.
122 bool has_user_gesture; 133 bool has_user_gesture;
134
135 // True if the ServiceWorker should be skipped.
136 bool skip_service_worker;
carlosk 2015/08/27 14:26:43 If we REALLY want to avoid adding more data fields
clamy 2015/08/27 15:19:03 Request context type is an enum part of the public
Fabrice (no longer in Chrome) 2015/08/28 15:40:16 That's not possible. ServiceWorker has its own, so
137
138 // Indicates if the current request is the main frame load, a sub-frame
139 // load, or a sub objects load.
clamy 2015/08/27 11:53:45 Is this really needed? You already know if you are
Fabrice (no longer in Chrome) 2015/08/28 15:40:16 I removed the frame type.
140 RequestContextType request_context_type;
141 RequestContextFrameType frame_type;
123 }; 142 };
124 143
125 // Provided by the browser ----------------------------------------------------- 144 // Provided by the browser -----------------------------------------------------
126 // 145 //
127 // These structs are sent by the browser to the renderer to start/commit a 146 // These structs are sent by the browser to the renderer to start/commit a
128 // navigation depending on whether browser-side navigation is enabled. 147 // navigation depending on whether browser-side navigation is enabled.
129 // Parameters used both in the current architecture and PlzNavigate should be 148 // Parameters used both in the current architecture and PlzNavigate should be
130 // put in RequestNavigationParams. Parameters only used by the current 149 // put in RequestNavigationParams. Parameters only used by the current
131 // architecture should go in StartNavigationParams. 150 // architecture should go in StartNavigationParams.
132 151
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 ~NavigationParams(); 287 ~NavigationParams();
269 288
270 CommonNavigationParams common_params; 289 CommonNavigationParams common_params;
271 StartNavigationParams start_params; 290 StartNavigationParams start_params;
272 RequestNavigationParams request_params; 291 RequestNavigationParams request_params;
273 }; 292 };
274 293
275 } // namespace content 294 } // namespace content
276 295
277 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ 296 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698