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

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

Issue 10942004: Cleanup: avoid foo ? true : false, part 2. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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/disk_cache/stress_cache.cc ('k') | net/url_request/url_request_file_dir_job.cc » ('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) 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
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
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
OLDNEW
« no previous file with comments | « net/disk_cache/stress_cache.cc ('k') | net/url_request/url_request_file_dir_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698