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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/json/json_value_converter.h" | 10 #include "base/json/json_value_converter.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 std::string host; | 34 std::string host; |
35 // Port of the server that supports QUIC. | 35 // Port of the server that supports QUIC. |
36 int port; | 36 int port; |
37 // Alternate protocol port. | 37 // Alternate protocol port. |
38 int alternate_port; | 38 int alternate_port; |
39 | 39 |
40 private: | 40 private: |
41 DISALLOW_COPY_AND_ASSIGN(QuicHint); | 41 DISALLOW_COPY_AND_ASSIGN(QuicHint); |
42 }; | 42 }; |
43 | 43 |
| 44 // Public-Key-Pinning configuration structure. |
| 45 struct Hpkp { |
| 46 Hpkp(){}; |
| 47 ~Hpkp(){}; |
| 48 |
| 49 // Register |converter| for use in converter.Convert(). |
| 50 static void RegisterJSONConverter( |
| 51 base::JSONValueConverter<Hpkp>* converter); |
| 52 |
| 53 // Host name. |
| 54 std::string host; |
| 55 // Pin hashes (currently SHA256 only). |
| 56 ScopedVector<std::string> pin_hashes; |
| 57 // Indicates whether the pinning should apply to the pinned host subdomains. |
| 58 bool include_subdomains; |
| 59 |
| 60 private: |
| 61 DISALLOW_COPY_AND_ASSIGN(Hpkp); |
| 62 }; |
| 63 |
44 URLRequestContextConfig(); | 64 URLRequestContextConfig(); |
45 ~URLRequestContextConfig(); | 65 ~URLRequestContextConfig(); |
46 | 66 |
47 // Load config values from JSON format. | 67 // Load config values from JSON format. |
48 bool LoadFromJSON(const std::string& config_string); | 68 bool LoadFromJSON(const std::string& config_string); |
49 | 69 |
50 // Configure |context_builder| based on |this|. | 70 // Configure |context_builder| based on |this|. |
51 void ConfigureURLRequestContextBuilder( | 71 void ConfigureURLRequestContextBuilder( |
52 net::URLRequestContextBuilder* context_builder); | 72 net::URLRequestContextBuilder* context_builder); |
53 | 73 |
(...skipping 21 matching lines...) Expand all Loading... |
75 std::string user_agent; | 95 std::string user_agent; |
76 // App-provided list of servers that support QUIC. | 96 // App-provided list of servers that support QUIC. |
77 ScopedVector<QuicHint> quic_hints; | 97 ScopedVector<QuicHint> quic_hints; |
78 // Comma-separated list of QUIC connection options. | 98 // Comma-separated list of QUIC connection options. |
79 std::string quic_connection_options; | 99 std::string quic_connection_options; |
80 // Enable Data Reduction Proxy with authentication key. | 100 // Enable Data Reduction Proxy with authentication key. |
81 std::string data_reduction_proxy_key; | 101 std::string data_reduction_proxy_key; |
82 std::string data_reduction_primary_proxy; | 102 std::string data_reduction_primary_proxy; |
83 std::string data_reduction_fallback_proxy; | 103 std::string data_reduction_fallback_proxy; |
84 std::string data_reduction_secure_proxy_check_url; | 104 std::string data_reduction_secure_proxy_check_url; |
| 105 // The list of public key pins. |
| 106 ScopedVector<Hpkp> hpkp_list; |
85 | 107 |
86 // Certificate verifier for testing. | 108 // Certificate verifier for testing. |
87 scoped_ptr<net::CertVerifier> mock_cert_verifier; | 109 scoped_ptr<net::CertVerifier> mock_cert_verifier; |
88 | 110 |
89 private: | 111 private: |
90 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); | 112 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); |
91 }; | 113 }; |
92 | 114 |
93 } // namespace cronet | 115 } // namespace cronet |
94 | 116 |
95 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ | 117 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ |
OLD | NEW |