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

Side by Side Diff: net/url_request/url_request_context.h

Issue 2546213003: Implement net/ support for Android's NetworkSecurityPolicy (Closed)
Patch Set: Address comments and add test Created 4 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This class represents contextual information (cookies, cache, etc.) 5 // This class represents contextual information (cookies, cache, etc.)
6 // that's necessary when processing resource requests. 6 // that's necessary when processing resource requests.
7 7
8 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 8 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
9 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 9 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
10 10
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 void set_network_quality_estimator( 224 void set_network_quality_estimator(
225 NetworkQualityEstimator* network_quality_estimator) { 225 NetworkQualityEstimator* network_quality_estimator) {
226 network_quality_estimator_ = network_quality_estimator; 226 network_quality_estimator_ = network_quality_estimator;
227 } 227 }
228 228
229 void set_enable_brotli(bool enable_brotli) { enable_brotli_ = enable_brotli; } 229 void set_enable_brotli(bool enable_brotli) { enable_brotli_ = enable_brotli; }
230 230
231 bool enable_brotli() const { return enable_brotli_; } 231 bool enable_brotli() const { return enable_brotli_; }
232 232
233 // Sets the |check_cleartext_permitted| flag, which controls whether to check
234 // system policy before allowing a cleartext http or ws request.
235 void set_check_cleartext_permitted(bool check_cleartext_permitted) {
236 check_cleartext_permitted_ = check_cleartext_permitted;
237 }
238
239 // Returns current value of the |check_cleartext_permitted| flag.
240 bool check_cleartext_permitted() const { return check_cleartext_permitted_; }
241
233 private: 242 private:
234 // --------------------------------------------------------------------------- 243 // ---------------------------------------------------------------------------
235 // Important: When adding any new members below, consider whether they need to 244 // Important: When adding any new members below, consider whether they need to
236 // be added to CopyFrom. 245 // be added to CopyFrom.
237 // --------------------------------------------------------------------------- 246 // ---------------------------------------------------------------------------
238 247
239 // Ownership for these members are not defined here. Clients should either 248 // Ownership for these members are not defined here. Clients should either
240 // provide storage elsewhere or have a subclass take ownership. 249 // provide storage elsewhere or have a subclass take ownership.
241 NetLog* net_log_; 250 NetLog* net_log_;
242 HostResolver* host_resolver_; 251 HostResolver* host_resolver_;
(...skipping 18 matching lines...) Expand all
261 270
262 // --------------------------------------------------------------------------- 271 // ---------------------------------------------------------------------------
263 // Important: When adding any new members below, consider whether they need to 272 // Important: When adding any new members below, consider whether they need to
264 // be added to CopyFrom. 273 // be added to CopyFrom.
265 // --------------------------------------------------------------------------- 274 // ---------------------------------------------------------------------------
266 275
267 std::unique_ptr<std::set<const URLRequest*>> url_requests_; 276 std::unique_ptr<std::set<const URLRequest*>> url_requests_;
268 277
269 // Enables Brotli Content-Encoding support. 278 // Enables Brotli Content-Encoding support.
270 bool enable_brotli_; 279 bool enable_brotli_;
280 // Enables checking system policy before allowing a cleartext http or ws
281 // request. Only used on Android.
282 bool check_cleartext_permitted_;
271 283
272 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); 284 DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
273 }; 285 };
274 286
275 } // namespace net 287 } // namespace net
276 288
277 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 289 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698