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

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

Issue 2546213003: Implement net/ support for Android's NetworkSecurityPolicy (Closed)
Patch Set: fixes 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 void set_network_quality_estimator( 232 void set_network_quality_estimator(
233 NetworkQualityEstimator* network_quality_estimator) { 233 NetworkQualityEstimator* network_quality_estimator) {
234 network_quality_estimator_ = network_quality_estimator; 234 network_quality_estimator_ = network_quality_estimator;
235 } 235 }
236 236
237 void set_enable_brotli(bool enable_brotli) { enable_brotli_ = enable_brotli; } 237 void set_enable_brotli(bool enable_brotli) { enable_brotli_ = enable_brotli; }
238 238
239 bool enable_brotli() const { return enable_brotli_; } 239 bool enable_brotli() const { return enable_brotli_; }
240 240
241 // Sets the |check_cleartext_permitted| flag, which controls whether to check
242 // system policy before allowing a cleartext http or ws request.
243 void set_check_cleartext_permitted(bool check_cleartext_permitted) {
244 check_cleartext_permitted_ = check_cleartext_permitted;
245 }
246
247 // Returns current value of the |check_cleartext_permitted| flag.
248 bool check_cleartext_permitted() const { return check_cleartext_permitted_; }
249
241 // Sets a name for this URLRequestContext. Currently the name is used in 250 // Sets a name for this URLRequestContext. Currently the name is used in
242 // MemoryDumpProvier to annotate memory usage. The name does not need to be 251 // MemoryDumpProvier to annotate memory usage. The name does not need to be
243 // unique. 252 // unique.
244 void set_name(const std::string& name) { name_ = name; } 253 void set_name(const std::string& name) { name_ = name; }
245 254
246 // MemoryDumpProvider implementation: 255 // MemoryDumpProvider implementation:
247 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, 256 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
248 base::trace_event::ProcessMemoryDump* pmd) override; 257 base::trace_event::ProcessMemoryDump* pmd) override;
249 258
250 private: 259 private:
(...skipping 27 matching lines...) Expand all
278 287
279 // --------------------------------------------------------------------------- 288 // ---------------------------------------------------------------------------
280 // Important: When adding any new members below, consider whether they need to 289 // Important: When adding any new members below, consider whether they need to
281 // be added to CopyFrom. 290 // be added to CopyFrom.
282 // --------------------------------------------------------------------------- 291 // ---------------------------------------------------------------------------
283 292
284 std::unique_ptr<std::set<const URLRequest*>> url_requests_; 293 std::unique_ptr<std::set<const URLRequest*>> url_requests_;
285 294
286 // Enables Brotli Content-Encoding support. 295 // Enables Brotli Content-Encoding support.
287 bool enable_brotli_; 296 bool enable_brotli_;
297 // Enables checking system policy before allowing a cleartext http or ws
298 // request. Only used on Android.
299 bool check_cleartext_permitted_;
288 300
289 // An optional name which can be set to describe this URLRequestContext. 301 // An optional name which can be set to describe this URLRequestContext.
290 // Used in MemoryDumpProvier to annotate memory usage. The name does not need 302 // Used in MemoryDumpProvier to annotate memory usage. The name does not need
291 // to be unique. 303 // to be unique.
292 std::string name_; 304 std::string name_;
293 305
294 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); 306 DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
295 }; 307 };
296 308
297 } // namespace net 309 } // namespace net
298 310
299 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 311 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698