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

Side by Side Diff: components/cronet/url_request_context_config.h

Issue 1407263010: [Cronet] Public key pinning for Java API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 5 years, 1 month 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 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"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/scoped_vector.h" 12 #include "base/memory/scoped_vector.h"
13 #include "base/time/time.h"
13 14
14 namespace net { 15 namespace net {
15 class CertVerifier; 16 class CertVerifier;
16 class URLRequestContextBuilder; 17 class URLRequestContextBuilder;
17 } // namespace net 18 } // namespace net
18 19
19 namespace cronet { 20 namespace cronet {
20 21
21 // Common configuration parameters used by Cronet to configure 22 // Common configuration parameters used by Cronet to configure
22 // URLRequestContext. Can be parsed from JSON string passed through JNI. 23 // URLRequestContext. Can be parsed from JSON string passed through JNI.
(...skipping 11 matching lines...) Expand all
34 std::string host; 35 std::string host;
35 // Port of the server that supports QUIC. 36 // Port of the server that supports QUIC.
36 int port; 37 int port;
37 // Alternate protocol port. 38 // Alternate protocol port.
38 int alternate_port; 39 int alternate_port;
39 40
40 private: 41 private:
41 DISALLOW_COPY_AND_ASSIGN(QuicHint); 42 DISALLOW_COPY_AND_ASSIGN(QuicHint);
42 }; 43 };
43 44
45 // Public-Key-Pinning configuration structure.
46 struct Hpkp {
47 Hpkp() {}
48 ~Hpkp() {}
49
50 // Register |converter| for use in converter.Convert().
51 static void RegisterJSONConverter(
52 base::JSONValueConverter<Hpkp>* converter);
53
54 // Host name.
55 std::string host;
56 // Pin hashes (currently SHA256 only).
57 ScopedVector<std::string> pin_hashes;
58 // Indicates whether the pinning should apply to the pinned host subdomains.
59 bool include_subdomains;
60 // Expiration date for the pins.
61 base::Time expiration_date;
62
63 private:
64 DISALLOW_COPY_AND_ASSIGN(Hpkp);
65 };
66
44 URLRequestContextConfig(); 67 URLRequestContextConfig();
45 ~URLRequestContextConfig(); 68 ~URLRequestContextConfig();
46 69
47 // Load config values from JSON format. 70 // Load config values from JSON format.
48 bool LoadFromJSON(const std::string& config_string); 71 bool LoadFromJSON(const std::string& config_string);
49 72
50 // Configure |context_builder| based on |this|. 73 // Configure |context_builder| based on |this|.
51 void ConfigureURLRequestContextBuilder( 74 void ConfigureURLRequestContextBuilder(
52 net::URLRequestContextBuilder* context_builder); 75 net::URLRequestContextBuilder* context_builder);
53 76
(...skipping 21 matching lines...) Expand all
75 std::string user_agent; 98 std::string user_agent;
76 // App-provided list of servers that support QUIC. 99 // App-provided list of servers that support QUIC.
77 ScopedVector<QuicHint> quic_hints; 100 ScopedVector<QuicHint> quic_hints;
78 // Comma-separated list of QUIC connection options. 101 // Comma-separated list of QUIC connection options.
79 std::string quic_connection_options; 102 std::string quic_connection_options;
80 // Enable Data Reduction Proxy with authentication key. 103 // Enable Data Reduction Proxy with authentication key.
81 std::string data_reduction_proxy_key; 104 std::string data_reduction_proxy_key;
82 std::string data_reduction_primary_proxy; 105 std::string data_reduction_primary_proxy;
83 std::string data_reduction_fallback_proxy; 106 std::string data_reduction_fallback_proxy;
84 std::string data_reduction_secure_proxy_check_url; 107 std::string data_reduction_secure_proxy_check_url;
108 // The list of public key pins.
109 ScopedVector<Hpkp> hpkp_list;
85 110
86 // Certificate verifier for testing. 111 // Certificate verifier for testing.
87 scoped_ptr<net::CertVerifier> mock_cert_verifier; 112 scoped_ptr<net::CertVerifier> mock_cert_verifier;
88 113
89 private: 114 private:
90 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig); 115 DISALLOW_COPY_AND_ASSIGN(URLRequestContextConfig);
91 }; 116 };
92 117
93 } // namespace cronet 118 } // namespace cronet
94 119
95 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_ 120 #endif // COMPONENTS_CRONET_URL_REQUEST_CONTEXT_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698