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

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

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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/base/x509_certificate_win.cc ('k') | net/socket/ssl_host_info.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // The rules for parsing content-types were borrowed from Firefox: 5 // The rules for parsing content-types were borrowed from Firefox:
6 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834 6 // http://lxr.mozilla.org/mozilla/source/netwerk/base/src/nsURLHelper.cpp#834
7 7
8 #include "net/http/http_util.h" 8 #include "net/http/http_util.h"
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 range.set_suffix_length(last_byte_position); 274 range.set_suffix_length(last_byte_position);
275 } else if (!range.HasFirstBytePosition()) { 275 } else if (!range.HasFirstBytePosition()) {
276 return false; 276 return false;
277 } 277 }
278 278
279 // Do a final check on the HttpByteRange object. 279 // Do a final check on the HttpByteRange object.
280 if (!range.IsValid()) 280 if (!range.IsValid())
281 return false; 281 return false;
282 ranges->push_back(range); 282 ranges->push_back(range);
283 } 283 }
284 return ranges->size() > 0; 284 return !ranges->empty();
285 } 285 }
286 286
287 // static 287 // static
288 bool HttpUtil::HasHeader(const std::string& headers, const char* name) { 288 bool HttpUtil::HasHeader(const std::string& headers, const char* name) {
289 size_t name_len = strlen(name); 289 size_t name_len = strlen(name);
290 string::const_iterator it = 290 string::const_iterator it =
291 std::search(headers.begin(), 291 std::search(headers.begin(),
292 headers.end(), 292 headers.end(),
293 name, 293 name,
294 name + name_len, 294 name + name_len,
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 value_is_quoted_ = true; 868 value_is_quoted_ = true;
869 // Do not store iterators into this. See declaration of unquoted_value_. 869 // Do not store iterators into this. See declaration of unquoted_value_.
870 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_); 870 unquoted_value_ = HttpUtil::Unquote(value_begin_, value_end_);
871 } 871 }
872 } 872 }
873 873
874 return true; 874 return true;
875 } 875 }
876 876
877 } // namespace net 877 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_certificate_win.cc ('k') | net/socket/ssl_host_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698