| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // This bit is set if the request has http authentication. | 87 // This bit is set if the request has http authentication. |
| 88 RESPONSE_INFO_USE_HTTP_AUTHENTICATION = 1 << 19, | 88 RESPONSE_INFO_USE_HTTP_AUTHENTICATION = 1 << 19, |
| 89 | 89 |
| 90 // TODO(darin): Add other bits to indicate alternate request methods. | 90 // TODO(darin): Add other bits to indicate alternate request methods. |
| 91 // For now, we don't support storing those. | 91 // For now, we don't support storing those. |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 HttpResponseInfo::HttpResponseInfo() | 94 HttpResponseInfo::HttpResponseInfo() |
| 95 : was_cached(false), | 95 : was_cached(false), |
| 96 server_data_unavailable(false), | 96 server_data_unavailable(false), |
| 97 network_accessed(false), |
| 97 was_fetched_via_spdy(false), | 98 was_fetched_via_spdy(false), |
| 98 was_npn_negotiated(false), | 99 was_npn_negotiated(false), |
| 99 was_fetched_via_proxy(false), | 100 was_fetched_via_proxy(false), |
| 100 did_use_http_auth(false), | 101 did_use_http_auth(false), |
| 101 connection_info(CONNECTION_INFO_UNKNOWN) { | 102 connection_info(CONNECTION_INFO_UNKNOWN) { |
| 102 } | 103 } |
| 103 | 104 |
| 104 HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) | 105 HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) |
| 105 : was_cached(rhs.was_cached), | 106 : was_cached(rhs.was_cached), |
| 106 server_data_unavailable(rhs.server_data_unavailable), | 107 server_data_unavailable(rhs.server_data_unavailable), |
| 108 network_accessed(rhs.network_accessed), |
| 107 was_fetched_via_spdy(rhs.was_fetched_via_spdy), | 109 was_fetched_via_spdy(rhs.was_fetched_via_spdy), |
| 108 was_npn_negotiated(rhs.was_npn_negotiated), | 110 was_npn_negotiated(rhs.was_npn_negotiated), |
| 109 was_fetched_via_proxy(rhs.was_fetched_via_proxy), | 111 was_fetched_via_proxy(rhs.was_fetched_via_proxy), |
| 110 did_use_http_auth(rhs.did_use_http_auth), | 112 did_use_http_auth(rhs.did_use_http_auth), |
| 111 socket_address(rhs.socket_address), | 113 socket_address(rhs.socket_address), |
| 112 npn_negotiated_protocol(rhs.npn_negotiated_protocol), | 114 npn_negotiated_protocol(rhs.npn_negotiated_protocol), |
| 113 connection_info(rhs.connection_info), | 115 connection_info(rhs.connection_info), |
| 114 request_time(rhs.request_time), | 116 request_time(rhs.request_time), |
| 115 response_time(rhs.response_time), | 117 response_time(rhs.response_time), |
| 116 auth_challenge(rhs.auth_challenge), | 118 auth_challenge(rhs.auth_challenge), |
| 117 cert_request_info(rhs.cert_request_info), | 119 cert_request_info(rhs.cert_request_info), |
| 118 ssl_info(rhs.ssl_info), | 120 ssl_info(rhs.ssl_info), |
| 119 headers(rhs.headers), | 121 headers(rhs.headers), |
| 120 vary_data(rhs.vary_data), | 122 vary_data(rhs.vary_data), |
| 121 metadata(rhs.metadata) { | 123 metadata(rhs.metadata) { |
| 122 } | 124 } |
| 123 | 125 |
| 124 HttpResponseInfo::~HttpResponseInfo() { | 126 HttpResponseInfo::~HttpResponseInfo() { |
| 125 } | 127 } |
| 126 | 128 |
| 127 HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) { | 129 HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) { |
| 128 was_cached = rhs.was_cached; | 130 was_cached = rhs.was_cached; |
| 129 server_data_unavailable = rhs.server_data_unavailable; | 131 server_data_unavailable = rhs.server_data_unavailable; |
| 132 network_accessed = rhs.network_accessed; |
| 130 was_fetched_via_spdy = rhs.was_fetched_via_spdy; | 133 was_fetched_via_spdy = rhs.was_fetched_via_spdy; |
| 131 was_npn_negotiated = rhs.was_npn_negotiated; | 134 was_npn_negotiated = rhs.was_npn_negotiated; |
| 132 was_fetched_via_proxy = rhs.was_fetched_via_proxy; | 135 was_fetched_via_proxy = rhs.was_fetched_via_proxy; |
| 133 did_use_http_auth = rhs.did_use_http_auth; | 136 did_use_http_auth = rhs.did_use_http_auth; |
| 134 socket_address = rhs.socket_address; | 137 socket_address = rhs.socket_address; |
| 135 npn_negotiated_protocol = rhs.npn_negotiated_protocol; | 138 npn_negotiated_protocol = rhs.npn_negotiated_protocol; |
| 136 request_time = rhs.request_time; | 139 request_time = rhs.request_time; |
| 137 response_time = rhs.response_time; | 140 response_time = rhs.response_time; |
| 138 auth_challenge = rhs.auth_challenge; | 141 auth_challenge = rhs.auth_challenge; |
| 139 cert_request_info = rhs.cert_request_info; | 142 cert_request_info = rhs.cert_request_info; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 pickle->WriteUInt16(socket_address.port()); | 321 pickle->WriteUInt16(socket_address.port()); |
| 319 | 322 |
| 320 if (was_npn_negotiated) | 323 if (was_npn_negotiated) |
| 321 pickle->WriteString(npn_negotiated_protocol); | 324 pickle->WriteString(npn_negotiated_protocol); |
| 322 | 325 |
| 323 if (connection_info != CONNECTION_INFO_UNKNOWN) | 326 if (connection_info != CONNECTION_INFO_UNKNOWN) |
| 324 pickle->WriteInt(static_cast<int>(connection_info)); | 327 pickle->WriteInt(static_cast<int>(connection_info)); |
| 325 } | 328 } |
| 326 | 329 |
| 327 } // namespace net | 330 } // namespace net |
| OLD | NEW |