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

Side by Side Diff: net/http/http_response_info.cc

Issue 7969023: For the SSL cert status, convert anonymous enum that gives bit values into a typedefed uint32. Th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/http/http_network_transaction_unittest.cc ('k') | net/http/http_transaction_unittest.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/http/http_response_info.h" 5 #include "net/http/http_response_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "net/base/auth.h" 10 #include "net/base/auth.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // read ssl-info 144 // read ssl-info
145 if (flags & RESPONSE_INFO_HAS_CERT) { 145 if (flags & RESPONSE_INFO_HAS_CERT) {
146 X509Certificate::PickleType type = (version == 1) ? 146 X509Certificate::PickleType type = (version == 1) ?
147 X509Certificate::PICKLETYPE_SINGLE_CERTIFICATE : 147 X509Certificate::PICKLETYPE_SINGLE_CERTIFICATE :
148 X509Certificate::PICKLETYPE_CERTIFICATE_CHAIN; 148 X509Certificate::PICKLETYPE_CERTIFICATE_CHAIN;
149 ssl_info.cert = X509Certificate::CreateFromPickle(pickle, &iter, type); 149 ssl_info.cert = X509Certificate::CreateFromPickle(pickle, &iter, type);
150 if (!ssl_info.cert) 150 if (!ssl_info.cert)
151 return false; 151 return false;
152 } 152 }
153 if (flags & RESPONSE_INFO_HAS_CERT_STATUS) { 153 if (flags & RESPONSE_INFO_HAS_CERT_STATUS) {
154 int cert_status; 154 CertStatus cert_status;
155 if (!pickle.ReadInt(&iter, &cert_status)) 155 if (!pickle.ReadUInt32(&iter, &cert_status))
156 return false; 156 return false;
157 ssl_info.cert_status = cert_status; 157 ssl_info.cert_status = cert_status;
158 } 158 }
159 if (flags & RESPONSE_INFO_HAS_SECURITY_BITS) { 159 if (flags & RESPONSE_INFO_HAS_SECURITY_BITS) {
160 int security_bits; 160 int security_bits;
161 if (!pickle.ReadInt(&iter, &security_bits)) 161 if (!pickle.ReadInt(&iter, &security_bits))
162 return false; 162 return false;
163 ssl_info.security_bits = security_bits; 163 ssl_info.security_bits = security_bits;
164 } 164 }
165 165
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 net::HttpResponseHeaders::PERSIST_SANS_CHALLENGES | 237 net::HttpResponseHeaders::PERSIST_SANS_CHALLENGES |
238 net::HttpResponseHeaders::PERSIST_SANS_HOP_BY_HOP | 238 net::HttpResponseHeaders::PERSIST_SANS_HOP_BY_HOP |
239 net::HttpResponseHeaders::PERSIST_SANS_NON_CACHEABLE | 239 net::HttpResponseHeaders::PERSIST_SANS_NON_CACHEABLE |
240 net::HttpResponseHeaders::PERSIST_SANS_RANGES; 240 net::HttpResponseHeaders::PERSIST_SANS_RANGES;
241 } 241 }
242 242
243 headers->Persist(pickle, persist_options); 243 headers->Persist(pickle, persist_options);
244 244
245 if (ssl_info.is_valid()) { 245 if (ssl_info.is_valid()) {
246 ssl_info.cert->Persist(pickle); 246 ssl_info.cert->Persist(pickle);
247 pickle->WriteInt(ssl_info.cert_status); 247 pickle->WriteUInt32(ssl_info.cert_status);
248 if (ssl_info.security_bits != -1) 248 if (ssl_info.security_bits != -1)
249 pickle->WriteInt(ssl_info.security_bits); 249 pickle->WriteInt(ssl_info.security_bits);
250 if (ssl_info.connection_status != 0) 250 if (ssl_info.connection_status != 0)
251 pickle->WriteInt(ssl_info.connection_status); 251 pickle->WriteInt(ssl_info.connection_status);
252 } 252 }
253 253
254 if (vary_data.is_valid()) 254 if (vary_data.is_valid())
255 vary_data.Persist(pickle); 255 vary_data.Persist(pickle);
256 256
257 pickle->WriteString(socket_address.host()); 257 pickle->WriteString(socket_address.host());
258 pickle->WriteUInt16(socket_address.port()); 258 pickle->WriteUInt16(socket_address.port());
259 } 259 }
260 260
261 } // namespace net 261 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_transaction_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698