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

Side by Side Diff: net/base/dnssec_chain_verifier.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/cookie_monster.cc ('k') | net/base/x509_cert_types_mac.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 #include "net/base/dnssec_chain_verifier.h" 5 #include "net/base/dnssec_chain_verifier.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/sha1.h" 9 #include "base/sha1.h"
10 #include "base/sha2.h" 10 #include "base/sha2.h"
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 725
726 for (unsigned i = 0; i < num_ds; i++) { 726 for (unsigned i = 0; i < num_ds; i++) {
727 uint8 digest_type; 727 uint8 digest_type;
728 base::StringPiece digest; 728 base::StringPiece digest;
729 if (!U8(&digest_type) || 729 if (!U8(&digest_type) ||
730 !VariableLength16(&digest)) { 730 !VariableLength16(&digest)) {
731 return BAD_DATA; 731 return BAD_DATA;
732 } 732 }
733 733
734 digest_types[i] = digest_type; 734 digest_types[i] = digest_type;
735 if (digest.size() > 0) { 735 lookahead[i] = digest.empty();
736 if (!digest.empty())
736 (*rrdatas)[i] = digest; 737 (*rrdatas)[i] = digest;
737 lookahead[i] = false;
738 } else {
739 lookahead[i] = true;
740 }
741 } 738 }
742 739
743 base::StringPiece next_entry_key; 740 base::StringPiece next_entry_key;
744 if (!ReadAheadEntryKey(&next_entry_key)) 741 if (!ReadAheadEntryKey(&next_entry_key))
745 return BAD_DATA; 742 return BAD_DATA;
746 if (next_entry_key.size() < 4) 743 if (next_entry_key.size() < 4)
747 return BAD_DATA; 744 return BAD_DATA;
748 uint16 keyid = DNSSECKeySet::DNSKEYToKeyID(next_entry_key); 745 uint16 keyid = DNSSECKeySet::DNSKEYToKeyID(next_entry_key);
749 uint8 algorithm = next_entry_key[3]; 746 uint8 algorithm = next_entry_key[3];
750 747
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 base::StringPiece name; 801 base::StringPiece name;
805 if (!ReadName(&name)) 802 if (!ReadName(&name))
806 return BAD_DATA; 803 return BAD_DATA;
807 804
808 rrdatas->resize(1); 805 rrdatas->resize(1);
809 (*rrdatas)[0] = name; 806 (*rrdatas)[0] = name;
810 return OK; 807 return OK;
811 } 808 }
812 809
813 } // namespace net 810 } // namespace net
OLDNEW
« no previous file with comments | « net/base/cookie_monster.cc ('k') | net/base/x509_cert_types_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698