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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 if (!pickle.ReadString(&iter, &npn_negotiated_protocol)) | 214 if (!pickle.ReadString(&iter, &npn_negotiated_protocol)) |
215 return false; | 215 return false; |
216 } | 216 } |
217 | 217 |
218 was_fetched_via_spdy = (flags & RESPONSE_INFO_WAS_SPDY) != 0; | 218 was_fetched_via_spdy = (flags & RESPONSE_INFO_WAS_SPDY) != 0; |
219 | 219 |
220 was_npn_negotiated = (flags & RESPONSE_INFO_WAS_NPN) != 0; | 220 was_npn_negotiated = (flags & RESPONSE_INFO_WAS_NPN) != 0; |
221 | 221 |
222 was_fetched_via_proxy = (flags & RESPONSE_INFO_WAS_PROXY) != 0; | 222 was_fetched_via_proxy = (flags & RESPONSE_INFO_WAS_PROXY) != 0; |
223 | 223 |
224 *response_truncated = (flags & RESPONSE_INFO_TRUNCATED) ? true : false; | 224 *response_truncated = (flags & RESPONSE_INFO_TRUNCATED) != 0; |
225 | 225 |
226 return true; | 226 return true; |
227 } | 227 } |
228 | 228 |
229 void HttpResponseInfo::Persist(Pickle* pickle, | 229 void HttpResponseInfo::Persist(Pickle* pickle, |
230 bool skip_transient_headers, | 230 bool skip_transient_headers, |
231 bool response_truncated) const { | 231 bool response_truncated) const { |
232 int flags = RESPONSE_INFO_VERSION; | 232 int flags = RESPONSE_INFO_VERSION; |
233 if (ssl_info.is_valid()) { | 233 if (ssl_info.is_valid()) { |
234 flags |= RESPONSE_INFO_HAS_CERT; | 234 flags |= RESPONSE_INFO_HAS_CERT; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 vary_data.Persist(pickle); | 283 vary_data.Persist(pickle); |
284 | 284 |
285 pickle->WriteString(socket_address.host()); | 285 pickle->WriteString(socket_address.host()); |
286 pickle->WriteUInt16(socket_address.port()); | 286 pickle->WriteUInt16(socket_address.port()); |
287 | 287 |
288 if (was_npn_negotiated) | 288 if (was_npn_negotiated) |
289 pickle->WriteString(npn_negotiated_protocol); | 289 pickle->WriteString(npn_negotiated_protocol); |
290 } | 290 } |
291 | 291 |
292 } // namespace net | 292 } // namespace net |
OLD | NEW |