| OLD | NEW |
| 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 COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ | 5 #ifndef COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |
| 6 #define COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ | 6 #define COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "net/base/hash_value.h" | 15 #include "net/base/hash_value.h" |
| 16 #include "net/cert/cert_verifier.h" | 16 #include "net/cert/cert_verifier.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class DictionaryValue; | |
| 20 class SequencedTaskRunner; | 19 class SequencedTaskRunner; |
| 21 } // namespace base | 20 } // namespace base |
| 22 | 21 |
| 23 namespace net { | 22 namespace net { |
| 24 class CertVerifier; | 23 class CertVerifier; |
| 25 class NetLog; | 24 class NetLog; |
| 26 class URLRequestContextBuilder; | 25 class URLRequestContextBuilder; |
| 27 } // namespace net | 26 } // namespace net |
| 28 | 27 |
| 29 namespace cronet { | 28 namespace cronet { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // MockCertVerifier to use for testing purposes. | 110 // MockCertVerifier to use for testing purposes. |
| 112 std::unique_ptr<net::CertVerifier> mock_cert_verifier, | 111 std::unique_ptr<net::CertVerifier> mock_cert_verifier, |
| 113 // Enable network quality estimator. | 112 // Enable network quality estimator. |
| 114 bool enable_network_quality_estimator, | 113 bool enable_network_quality_estimator, |
| 115 // Enable bypassing of public key pinning for local trust anchors | 114 // Enable bypassing of public key pinning for local trust anchors |
| 116 bool bypass_public_key_pinning_for_local_trust_anchors, | 115 bool bypass_public_key_pinning_for_local_trust_anchors, |
| 117 // Certificate verifier cache data. | 116 // Certificate verifier cache data. |
| 118 const std::string& cert_verifier_data); | 117 const std::string& cert_verifier_data); |
| 119 ~URLRequestContextConfig(); | 118 ~URLRequestContextConfig(); |
| 120 | 119 |
| 121 // Configures |context_builder| based on |this|. | 120 // Configure |context_builder| based on |this|. |
| 122 void ConfigureURLRequestContextBuilder( | 121 void ConfigureURLRequestContextBuilder( |
| 123 net::URLRequestContextBuilder* context_builder, | 122 net::URLRequestContextBuilder* context_builder, |
| 124 net::NetLog* net_log, | 123 net::NetLog* net_log, |
| 125 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner); | 124 const scoped_refptr<base::SequencedTaskRunner>& file_task_runner); |
| 126 | 125 |
| 127 // Enable QUIC. | 126 // Enable QUIC. |
| 128 const bool enable_quic; | 127 const bool enable_quic; |
| 129 // QUIC User Agent ID. | 128 // QUIC User Agent ID. |
| 130 const std::string quic_user_agent_id; | 129 const std::string quic_user_agent_id; |
| 131 // Enable SPDY. | 130 // Enable SPDY. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 166 |
| 168 // Data to populte CertVerifierCache. | 167 // Data to populte CertVerifierCache. |
| 169 const std::string cert_verifier_data; | 168 const std::string cert_verifier_data; |
| 170 | 169 |
| 171 // App-provided list of servers that support QUIC. | 170 // App-provided list of servers that support QUIC. |
| 172 ScopedVector<QuicHint> quic_hints; | 171 ScopedVector<QuicHint> quic_hints; |
| 173 | 172 |
| 174 // The list of public key pins. | 173 // The list of public key pins. |
| 175 ScopedVector<Pkp> pkp_list; | 174 ScopedVector<Pkp> pkp_list; |
| 176 | 175 |
| 177 // Experimental options that are recognized by the config parser. | |
| 178 std::unique_ptr<base::DictionaryValue> effective_experimental_options; | |
| 179 | |
| 180 private: | 176 private: |
| 181 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); | 177 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); |
| 182 }; | 178 }; |
| 183 | 179 |
| 184 // Stores intermediate state for URLRequestContextConfig. Initializes with | 180 // Stores intermediate state for URLRequestContextConfig. Initializes with |
| 185 // (mostly) sane defaults, then the appropriate member variables can be | 181 // (mostly) sane defaults, then the appropriate member variables can be |
| 186 // modified, and it can be finalized with Build(). | 182 // modified, and it can be finalized with Build(). |
| 187 struct URLRequestContextConfigBuilder { | 183 struct URLRequestContextConfigBuilder { |
| 188 URLRequestContextConfigBuilder(); | 184 URLRequestContextConfigBuilder(); |
| 189 ~URLRequestContextConfigBuilder(); | 185 ~URLRequestContextConfigBuilder(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // Data to populate CertVerifierCache. | 234 // Data to populate CertVerifierCache. |
| 239 std::string cert_verifier_data = ""; | 235 std::string cert_verifier_data = ""; |
| 240 | 236 |
| 241 private: | 237 private: |
| 242 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfigBuilder); | 238 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfigBuilder); |
| 243 }; | 239 }; |
| 244 | 240 |
| 245 } // namespace cronet | 241 } // namespace cronet |
| 246 | 242 |
| 247 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ | 243 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |
| OLD | NEW |