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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 cert_request_info = rhs.cert_request_info; | 109 cert_request_info = rhs.cert_request_info; |
110 ssl_info = rhs.ssl_info; | 110 ssl_info = rhs.ssl_info; |
111 headers = rhs.headers; | 111 headers = rhs.headers; |
112 vary_data = rhs.vary_data; | 112 vary_data = rhs.vary_data; |
113 metadata = rhs.metadata; | 113 metadata = rhs.metadata; |
114 return *this; | 114 return *this; |
115 } | 115 } |
116 | 116 |
117 bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, | 117 bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, |
118 bool* response_truncated) { | 118 bool* response_truncated) { |
119 void* iter = NULL; | 119 PickleIterator iter(pickle); |
120 | 120 |
121 // read flags and verify version | 121 // read flags and verify version |
122 int flags; | 122 int flags; |
123 if (!pickle.ReadInt(&iter, &flags)) | 123 if (!pickle.ReadInt(&iter, &flags)) |
124 return false; | 124 return false; |
125 int version = flags & RESPONSE_INFO_VERSION_MASK; | 125 int version = flags & RESPONSE_INFO_VERSION_MASK; |
126 if (version < RESPONSE_INFO_MINIMUM_VERSION || | 126 if (version < RESPONSE_INFO_MINIMUM_VERSION || |
127 version > RESPONSE_INFO_VERSION) { | 127 version > RESPONSE_INFO_VERSION) { |
128 DLOG(ERROR) << "unexpected response info version: " << version; | 128 DLOG(ERROR) << "unexpected response info version: " << version; |
129 return false; | 129 return false; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 vary_data.Persist(pickle); | 269 vary_data.Persist(pickle); |
270 | 270 |
271 pickle->WriteString(socket_address.host()); | 271 pickle->WriteString(socket_address.host()); |
272 pickle->WriteUInt16(socket_address.port()); | 272 pickle->WriteUInt16(socket_address.port()); |
273 | 273 |
274 if (was_npn_negotiated) | 274 if (was_npn_negotiated) |
275 pickle->WriteString(npn_negotiated_protocol); | 275 pickle->WriteString(npn_negotiated_protocol); |
276 } | 276 } |
277 | 277 |
278 } // namespace net | 278 } // namespace net |
OLD | NEW |