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

Side by Side Diff: net/cert/signed_certificate_timestamp.cc

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « net/base/io_buffer.cc ('k') | net/cert/signed_certificate_timestamp_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/cert/signed_certificate_timestamp.h" 5 #include "net/cert/signed_certificate_timestamp.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 14 matching lines...) Expand all
25 return lhs->extensions < rhs->extensions; 25 return lhs->extensions < rhs->extensions;
26 if (lhs->origin != rhs->origin) 26 if (lhs->origin != rhs->origin)
27 return lhs->origin < rhs->origin; 27 return lhs->origin < rhs->origin;
28 return lhs->version < rhs->version; 28 return lhs->version < rhs->version;
29 } 29 }
30 30
31 SignedCertificateTimestamp::SignedCertificateTimestamp() {} 31 SignedCertificateTimestamp::SignedCertificateTimestamp() {}
32 32
33 SignedCertificateTimestamp::~SignedCertificateTimestamp() {} 33 SignedCertificateTimestamp::~SignedCertificateTimestamp() {}
34 34
35 void SignedCertificateTimestamp::Persist(Pickle* pickle) { 35 void SignedCertificateTimestamp::Persist(base::Pickle* pickle) {
36 CHECK(pickle->WriteInt(version)); 36 CHECK(pickle->WriteInt(version));
37 CHECK(pickle->WriteString(log_id)); 37 CHECK(pickle->WriteString(log_id));
38 CHECK(pickle->WriteInt64(timestamp.ToInternalValue())); 38 CHECK(pickle->WriteInt64(timestamp.ToInternalValue()));
39 CHECK(pickle->WriteString(extensions)); 39 CHECK(pickle->WriteString(extensions));
40 CHECK(pickle->WriteInt(signature.hash_algorithm)); 40 CHECK(pickle->WriteInt(signature.hash_algorithm));
41 CHECK(pickle->WriteInt(signature.signature_algorithm)); 41 CHECK(pickle->WriteInt(signature.signature_algorithm));
42 CHECK(pickle->WriteString(signature.signature_data)); 42 CHECK(pickle->WriteString(signature.signature_data));
43 CHECK(pickle->WriteInt(origin)); 43 CHECK(pickle->WriteInt(origin));
44 CHECK(pickle->WriteString(log_description)); 44 CHECK(pickle->WriteString(log_description));
45 } 45 }
46 46
47 // static 47 // static
48 scoped_refptr<SignedCertificateTimestamp> 48 scoped_refptr<SignedCertificateTimestamp>
49 SignedCertificateTimestamp::CreateFromPickle(PickleIterator* iter) { 49 SignedCertificateTimestamp::CreateFromPickle(base::PickleIterator* iter) {
50 int version; 50 int version;
51 int64 timestamp; 51 int64 timestamp;
52 int hash_algorithm; 52 int hash_algorithm;
53 int sig_algorithm; 53 int sig_algorithm;
54 scoped_refptr<SignedCertificateTimestamp> sct( 54 scoped_refptr<SignedCertificateTimestamp> sct(
55 new SignedCertificateTimestamp()); 55 new SignedCertificateTimestamp());
56 int origin; 56 int origin;
57 // string values are set directly 57 // string values are set directly
58 if (!(iter->ReadInt(&version) && 58 if (!(iter->ReadInt(&version) &&
59 iter->ReadString(&sct->log_id) && 59 iter->ReadString(&sct->log_id) &&
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 bool DigitallySigned::SignatureParametersMatch( 94 bool DigitallySigned::SignatureParametersMatch(
95 HashAlgorithm other_hash_algorithm, 95 HashAlgorithm other_hash_algorithm,
96 SignatureAlgorithm other_signature_algorithm) const { 96 SignatureAlgorithm other_signature_algorithm) const {
97 return (hash_algorithm == other_hash_algorithm) && 97 return (hash_algorithm == other_hash_algorithm) &&
98 (signature_algorithm == other_signature_algorithm); 98 (signature_algorithm == other_signature_algorithm);
99 } 99 }
100 } // namespace ct 100 } // namespace ct
101 101
102 } // namespace net 102 } // namespace net
OLDNEW
« no previous file with comments | « net/base/io_buffer.cc ('k') | net/cert/signed_certificate_timestamp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698