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

Side by Side Diff: content/common/ssl_status_serialization.cc

Issue 825353003: Revert of Remove deprecated methods from Pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « content/common/resource_messages.cc ('k') | content/public/common/common_param_traits.h » ('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 "content/common/ssl_status_serialization.h" 5 #include "content/common/ssl_status_serialization.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 *cert_status = 0; 47 *cert_status = 0;
48 *security_bits = -1; 48 *security_bits = -1;
49 *ssl_connection_status = 0; 49 *ssl_connection_status = 0;
50 signed_certificate_timestamp_ids->clear(); 50 signed_certificate_timestamp_ids->clear();
51 return false; 51 return false;
52 } 52 }
53 53
54 Pickle pickle(state.data(), static_cast<int>(state.size())); 54 Pickle pickle(state.data(), static_cast<int>(state.size()));
55 PickleIterator iter(pickle); 55 PickleIterator iter(pickle);
56 int num_scts_to_read; 56 int num_scts_to_read;
57 if (!iter.ReadInt(cert_id) || 57 if (!pickle.ReadInt(&iter, cert_id) ||
58 !iter.ReadUInt32(cert_status) || 58 !pickle.ReadUInt32(&iter, cert_status) ||
59 !iter.ReadInt(security_bits) || 59 !pickle.ReadInt(&iter, security_bits) ||
60 !iter.ReadInt(ssl_connection_status) || 60 !pickle.ReadInt(&iter, ssl_connection_status) ||
61 !iter.ReadInt(&num_scts_to_read)) 61 !pickle.ReadInt(&iter, &num_scts_to_read))
62 return false; 62 return false;
63 63
64 for (; num_scts_to_read > 0; --num_scts_to_read) { 64 for (; num_scts_to_read > 0; --num_scts_to_read) {
65 int id; 65 int id;
66 uint16 status; 66 uint16 status;
67 if (!iter.ReadInt(&id) || !iter.ReadUInt16(&status)) 67 if (!pickle.ReadInt(&iter, &id) ||
68 !pickle.ReadUInt16(&iter, &status))
68 return false; 69 return false;
69 signed_certificate_timestamp_ids->push_back( 70 signed_certificate_timestamp_ids->push_back(
70 SignedCertificateTimestampIDAndStatus( 71 SignedCertificateTimestampIDAndStatus(
71 id, 72 id,
72 static_cast<net::ct::SCTVerifyStatus>(status))); 73 static_cast<net::ct::SCTVerifyStatus>(status)));
73 } 74 }
74 75
75 return true; 76 return true;
76 } 77 }
77 78
78 } // namespace content 79 } // namespace content
OLDNEW
« no previous file with comments | « content/common/resource_messages.cc ('k') | content/public/common/common_param_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698