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

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

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Addressed all jam@ latest comments. Created 3 years, 11 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 12
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/optional.h" 14 #include "base/optional.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "build/build_config.h" 16 #include "build/build_config.h"
17 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
18 #include "content/common/frame_message_enums.h" 18 #include "content/common/frame_message_enums.h"
19 #include "content/common/resource_request_body_impl.h" 19 #include "content/common/resource_request_body_impl.h"
20 #include "content/public/common/page_state.h" 20 #include "content/public/common/page_state.h"
21 #include "content/public/common/referrer.h" 21 #include "content/public/common/referrer.h"
22 #include "content/public/common/request_context_type.h" 22 #include "content/public/common/request_context_type.h"
23 #include "content/public/common/resource_response.h" 23 #include "content/public/common/resource_response.h"
24 #include "ui/base/page_transition_types.h" 24 #include "ui/base/page_transition_types.h"
25 #include "url/gurl.h" 25 #include "url/gurl.h"
26 #include "url/origin.h" 26 #include "url/origin.h"
27 27
28 namespace blink {
29 enum class WebMixedContentContextType;
jam 2017/01/09 21:15:46 nit: why not just include the header here?
carlosk 2017/01/10 19:13:11 Done. Agreed... Here and in all other places where
30 }
31
28 namespace content { 32 namespace content {
29 33
30 // The LoFi state which determines whether to add the Lo-Fi header. 34 // The LoFi state which determines whether to add the Lo-Fi header.
31 enum LoFiState { 35 enum LoFiState {
32 // Let the browser process decide whether or not to request the Lo-Fi version. 36 // Let the browser process decide whether or not to request the Lo-Fi version.
33 LOFI_UNSPECIFIED = 0, 37 LOFI_UNSPECIFIED = 0,
34 38
35 // Request a normal (non-Lo-Fi) version of the resource. 39 // Request a normal (non-Lo-Fi) version of the resource.
36 LOFI_OFF, 40 LOFI_OFF,
37 41
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // used in PlzNavigate (since in the current architecture, the renderer does not 141 // used in PlzNavigate (since in the current architecture, the renderer does not
138 // inform the browser of navigations until they commit). 142 // inform the browser of navigations until they commit).
139 143
140 // This struct is not used outside of the PlzNavigate project. 144 // This struct is not used outside of the PlzNavigate project.
141 // PlzNavigate: parameters needed to start a navigation on the IO thread, 145 // PlzNavigate: parameters needed to start a navigation on the IO thread,
142 // following a renderer-initiated navigation request. 146 // following a renderer-initiated navigation request.
143 struct CONTENT_EXPORT BeginNavigationParams { 147 struct CONTENT_EXPORT BeginNavigationParams {
144 // TODO(clamy): See if it is possible to reuse this in 148 // TODO(clamy): See if it is possible to reuse this in
145 // ResourceMsg_Request_Params. 149 // ResourceMsg_Request_Params.
146 BeginNavigationParams(); 150 BeginNavigationParams();
147 BeginNavigationParams(std::string headers, 151 BeginNavigationParams(
148 int load_flags, 152 std::string headers,
149 bool has_user_gesture, 153 int load_flags,
150 bool skip_service_worker, 154 bool has_user_gesture,
151 RequestContextType request_context_type, 155 bool skip_service_worker,
152 const base::Optional<url::Origin>& initiator_origin); 156 RequestContextType request_context_type,
157 blink::WebMixedContentContextType mixed_content_context_type,
158 const base::Optional<url::Origin>& initiator_origin);
153 BeginNavigationParams(const BeginNavigationParams& other); 159 BeginNavigationParams(const BeginNavigationParams& other);
154 ~BeginNavigationParams(); 160 ~BeginNavigationParams();
155 161
156 // Additional HTTP request headers. 162 // Additional HTTP request headers.
157 std::string headers; 163 std::string headers;
158 164
159 // net::URLRequest load flags (net::LOAD_NORMAL) by default). 165 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
160 int load_flags; 166 int load_flags;
161 167
162 // True if the request was user initiated. 168 // True if the request was user initiated.
163 bool has_user_gesture; 169 bool has_user_gesture;
164 170
165 // True if the ServiceWorker should be skipped. 171 // True if the ServiceWorker should be skipped.
166 bool skip_service_worker; 172 bool skip_service_worker;
167 173
168 // Indicates the request context type. 174 // Indicates the request context type.
169 RequestContextType request_context_type; 175 RequestContextType request_context_type;
170 176
177 // The mixed content context type for potential mixed content checks.
178 blink::WebMixedContentContextType mixed_content_context_type;
179
171 // See WebSearchableFormData for a description of these. 180 // See WebSearchableFormData for a description of these.
172 GURL searchable_form_url; 181 GURL searchable_form_url;
173 std::string searchable_form_encoding; 182 std::string searchable_form_encoding;
174 183
175 // Indicates the initiator of the request. In auxilliary navigations, this is 184 // Indicates the initiator of the request. In auxilliary navigations, this is
176 // the origin of the document that triggered the navigation. This parameter 185 // the origin of the document that triggered the navigation. This parameter
177 // can be null during browser-initiated navigations. 186 // can be null during browser-initiated navigations.
178 base::Optional<url::Origin> initiator_origin; 187 base::Optional<url::Origin> initiator_origin;
179 }; 188 };
180 189
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 ~NavigationParams(); 368 ~NavigationParams();
360 369
361 CommonNavigationParams common_params; 370 CommonNavigationParams common_params;
362 StartNavigationParams start_params; 371 StartNavigationParams start_params;
363 RequestNavigationParams request_params; 372 RequestNavigationParams request_params;
364 }; 373 };
365 374
366 } // namespace content 375 } // namespace content
367 376
368 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ 377 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698