| Index: net/http/http_response_info.cc
|
| diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
|
| index 2c23faac4e1bb7e21ad81fa9cbd38e12f5b2beec..5d083065976ebf3667fa0e7103b60ba515a86ea7 100644
|
| --- a/net/http/http_response_info.cc
|
| +++ b/net/http/http_response_info.cc
|
| @@ -56,6 +56,9 @@ enum {
|
| // will ingore the alternate protocol if spdy is not enabled.
|
| RESPONSE_INFO_WAS_ALTERNATE_PROTOCOL_AVAILABLE = 1 << 16,
|
|
|
| + // This bit is set if the response info has a TLS username.
|
| + RESPONSE_INFO_HAS_TLS_USERNAME = 1 << 17,
|
| +
|
| // TODO(darin): Add other bits to indicate alternate request methods.
|
| // For now, we don't support storing those.
|
| };
|
| @@ -78,6 +81,7 @@ HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs)
|
| response_time(rhs.response_time),
|
| auth_challenge(rhs.auth_challenge),
|
| cert_request_info(rhs.cert_request_info),
|
| + login_request_info(rhs.login_request_info),
|
| ssl_info(rhs.ssl_info),
|
| headers(rhs.headers),
|
| vary_data(rhs.vary_data),
|
| @@ -97,6 +101,7 @@ HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) {
|
| response_time = rhs.response_time;
|
| auth_challenge = rhs.auth_challenge;
|
| cert_request_info = rhs.cert_request_info;
|
| + login_request_info = rhs.login_request_info;
|
| ssl_info = rhs.ssl_info;
|
| headers = rhs.headers;
|
| vary_data = rhs.vary_data;
|
| @@ -139,6 +144,12 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
|
| ssl_info.cert =
|
| X509Certificate::CreateFromPickle(pickle, &iter);
|
| }
|
| + if (flags & RESPONSE_INFO_HAS_TLS_USERNAME) {
|
| + string16 tls_username;
|
| + if (!pickle.ReadString16(&iter, &tls_username))
|
| + return false;
|
| + ssl_info.tls_username = tls_username;
|
| + }
|
| if (flags & RESPONSE_INFO_HAS_CERT_STATUS) {
|
| int cert_status;
|
| if (!pickle.ReadInt(&iter, &cert_status))
|
| @@ -177,7 +188,10 @@ void HttpResponseInfo::Persist(Pickle* pickle,
|
| bool response_truncated) const {
|
| int flags = RESPONSE_INFO_VERSION;
|
| if (ssl_info.is_valid()) {
|
| - flags |= RESPONSE_INFO_HAS_CERT;
|
| + if (ssl_info.cert.get())
|
| + flags |= RESPONSE_INFO_HAS_CERT;
|
| + if (!ssl_info.tls_username.empty())
|
| + flags |= RESPONSE_INFO_HAS_TLS_USERNAME;
|
| flags |= RESPONSE_INFO_HAS_CERT_STATUS;
|
| if (ssl_info.security_bits != -1)
|
| flags |= RESPONSE_INFO_HAS_SECURITY_BITS;
|
| @@ -215,7 +229,10 @@ void HttpResponseInfo::Persist(Pickle* pickle,
|
| headers->Persist(pickle, persist_options);
|
|
|
| if (ssl_info.is_valid()) {
|
| - ssl_info.cert->Persist(pickle);
|
| + if (flags & RESPONSE_INFO_HAS_CERT)
|
| + ssl_info.cert->Persist(pickle);
|
| + if (flags & RESPONSE_INFO_HAS_TLS_USERNAME)
|
| + pickle->WriteString16(ssl_info.tls_username);
|
| pickle->WriteInt(ssl_info.cert_status);
|
| if (ssl_info.security_bits != -1)
|
| pickle->WriteInt(ssl_info.security_bits);
|
|
|