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

Side by Side Diff: net/base/ssl_config_service.cc

Issue 6314010: Even more reordering the methods in headers and implementation in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_log.cc ('k') | net/base/transport_security_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "net/base/ssl_config_service.h" 5 #include "net/base/ssl_config_service.h"
6 #include "net/base/ssl_false_start_blacklist.h" 6 #include "net/base/ssl_false_start_blacklist.h"
7 7
8 #if defined(OS_WIN) 8 #if defined(OS_WIN)
9 #include "net/base/ssl_config_service_win.h" 9 #include "net/base/ssl_config_service_win.h"
10 #elif defined(OS_MACOSX) 10 #elif defined(OS_MACOSX)
(...skipping 25 matching lines...) Expand all
36 if (cert->Equals(allowed_bad_certs[i].cert)) 36 if (cert->Equals(allowed_bad_certs[i].cert))
37 return true; 37 return true;
38 } 38 }
39 return false; 39 return false;
40 } 40 }
41 41
42 SSLConfigService::SSLConfigService() 42 SSLConfigService::SSLConfigService()
43 : observer_list_(ObserverList<Observer>::NOTIFY_EXISTING_ONLY) { 43 : observer_list_(ObserverList<Observer>::NOTIFY_EXISTING_ONLY) {
44 } 44 }
45 45
46 SSLConfigService::~SSLConfigService() {
47 }
48
49 // static 46 // static
50 SSLConfigService* SSLConfigService::CreateSystemSSLConfigService() { 47 SSLConfigService* SSLConfigService::CreateSystemSSLConfigService() {
51 #if defined(OS_WIN) 48 #if defined(OS_WIN)
52 return new SSLConfigServiceWin; 49 return new SSLConfigServiceWin;
53 #elif defined(OS_MACOSX) 50 #elif defined(OS_MACOSX)
54 return new SSLConfigServiceMac; 51 return new SSLConfigServiceMac;
55 #else 52 #else
56 return new SSLConfigServiceDefaults; 53 return new SSLConfigServiceDefaults;
57 #endif 54 #endif
58 } 55 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return SSLFalseStartBlacklist::IsMember(hostname.c_str()); 90 return SSLFalseStartBlacklist::IsMember(hostname.c_str());
94 } 91 }
95 92
96 static bool g_dnssec_enabled = false; 93 static bool g_dnssec_enabled = false;
97 static bool g_false_start_enabled = true; 94 static bool g_false_start_enabled = true;
98 static bool g_mitm_proxies_allowed = false; 95 static bool g_mitm_proxies_allowed = false;
99 static bool g_snap_start_enabled = false; 96 static bool g_snap_start_enabled = false;
100 static bool g_dns_cert_provenance_checking = false; 97 static bool g_dns_cert_provenance_checking = false;
101 98
102 // static 99 // static
103 void SSLConfigService::SetSSLConfigFlags(SSLConfig* ssl_config) {
104 ssl_config->dnssec_enabled = g_dnssec_enabled;
105 ssl_config->false_start_enabled = g_false_start_enabled;
106 ssl_config->mitm_proxies_allowed = g_mitm_proxies_allowed;
107 ssl_config->snap_start_enabled = g_snap_start_enabled;
108 ssl_config->dns_cert_provenance_checking_enabled =
109 g_dns_cert_provenance_checking;
110 }
111
112 // static
113 void SSLConfigService::EnableDNSSEC() { 100 void SSLConfigService::EnableDNSSEC() {
114 g_dnssec_enabled = true; 101 g_dnssec_enabled = true;
115 } 102 }
116 103
117 // static 104 // static
118 bool SSLConfigService::dnssec_enabled() { 105 bool SSLConfigService::dnssec_enabled() {
119 return g_dnssec_enabled; 106 return g_dnssec_enabled;
120 } 107 }
121 108
122 // static 109 // static
123 void SSLConfigService::EnableSnapStart() { 110 void SSLConfigService::EnableSnapStart() {
124 g_snap_start_enabled = true; 111 g_snap_start_enabled = true;
125 } 112 }
126 113
127 // static 114 // static
128 bool SSLConfigService::snap_start_enabled() { 115 bool SSLConfigService::snap_start_enabled() {
129 return g_snap_start_enabled; 116 return g_snap_start_enabled;
130 } 117 }
131 118
132 // static 119 // static
120 void SSLConfigService::AllowMITMProxies() {
121 g_mitm_proxies_allowed = true;
122 }
123
124 // static
125 bool SSLConfigService::mitm_proxies_allowed() {
126 return g_mitm_proxies_allowed;
127 }
128
129 // static
133 void SSLConfigService::DisableFalseStart() { 130 void SSLConfigService::DisableFalseStart() {
134 g_false_start_enabled = false; 131 g_false_start_enabled = false;
135 } 132 }
136 133
137 // static 134 // static
138 bool SSLConfigService::false_start_enabled() { 135 bool SSLConfigService::false_start_enabled() {
139 return g_false_start_enabled; 136 return g_false_start_enabled;
140 } 137 }
141 138
142 // static 139 // static
143 void SSLConfigService::AllowMITMProxies() {
144 g_mitm_proxies_allowed = true;
145 }
146
147 // static
148 bool SSLConfigService::mitm_proxies_allowed() {
149 return g_mitm_proxies_allowed;
150 }
151
152 // static
153 void SSLConfigService::EnableDNSCertProvenanceChecking() { 140 void SSLConfigService::EnableDNSCertProvenanceChecking() {
154 g_dns_cert_provenance_checking = true; 141 g_dns_cert_provenance_checking = true;
155 } 142 }
156 143
157 // static 144 // static
158 bool SSLConfigService::dns_cert_provenance_checking_enabled() { 145 bool SSLConfigService::dns_cert_provenance_checking_enabled() {
159 return g_dns_cert_provenance_checking; 146 return g_dns_cert_provenance_checking;
160 } 147 }
161 148
162 void SSLConfigService::AddObserver(Observer* observer) { 149 void SSLConfigService::AddObserver(Observer* observer) {
163 observer_list_.AddObserver(observer); 150 observer_list_.AddObserver(observer);
164 } 151 }
165 152
166 void SSLConfigService::RemoveObserver(Observer* observer) { 153 void SSLConfigService::RemoveObserver(Observer* observer) {
167 observer_list_.RemoveObserver(observer); 154 observer_list_.RemoveObserver(observer);
168 } 155 }
169 156
157 SSLConfigService::~SSLConfigService() {
158 }
159
160 // static
161 void SSLConfigService::SetSSLConfigFlags(SSLConfig* ssl_config) {
162 ssl_config->dnssec_enabled = g_dnssec_enabled;
163 ssl_config->false_start_enabled = g_false_start_enabled;
164 ssl_config->mitm_proxies_allowed = g_mitm_proxies_allowed;
165 ssl_config->snap_start_enabled = g_snap_start_enabled;
166 ssl_config->dns_cert_provenance_checking_enabled =
167 g_dns_cert_provenance_checking;
168 }
169
170 void SSLConfigService::ProcessConfigUpdate(const SSLConfig& orig_config, 170 void SSLConfigService::ProcessConfigUpdate(const SSLConfig& orig_config,
171 const SSLConfig& new_config) { 171 const SSLConfig& new_config) {
172 if (orig_config.rev_checking_enabled != new_config.rev_checking_enabled || 172 if (orig_config.rev_checking_enabled != new_config.rev_checking_enabled ||
173 orig_config.ssl3_enabled != new_config.ssl3_enabled || 173 orig_config.ssl3_enabled != new_config.ssl3_enabled ||
174 orig_config.tls1_enabled != new_config.tls1_enabled) { 174 orig_config.tls1_enabled != new_config.tls1_enabled) {
175 FOR_EACH_OBSERVER(Observer, observer_list_, OnSSLConfigChanged()); 175 FOR_EACH_OBSERVER(Observer, observer_list_, OnSSLConfigChanged());
176 } 176 }
177 } 177 }
178 178
179 } // namespace net 179 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_log.cc ('k') | net/base/transport_security_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698