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

Unified Diff: crypto/secure_hash_default.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/secure_hash.h ('k') | crypto/secure_hash_openssl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/secure_hash_default.cc
diff --git a/crypto/secure_hash_default.cc b/crypto/secure_hash_default.cc
index 6607dfe27410824e93c1e2643a9d2647e4b77f01..834a276fbf9394541aa52dd37f628bdcfeb1ba39 100644
--- a/crypto/secure_hash_default.cc
+++ b/crypto/secure_hash_default.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -36,7 +36,7 @@ class SecureHashSHA256NSS : public SecureHash {
}
virtual bool Serialize(Pickle* pickle);
- virtual bool Deserialize(void** data_iterator, Pickle* pickle);
+ virtual bool Deserialize(PickleIterator* data_iterator);
private:
SHA256Context ctx_;
@@ -55,26 +55,23 @@ bool SecureHashSHA256NSS::Serialize(Pickle* pickle) {
return true;
}
-bool SecureHashSHA256NSS::Deserialize(void** data_iterator, Pickle* pickle) {
- if (!pickle)
- return false;
-
+bool SecureHashSHA256NSS::Deserialize(PickleIterator* data_iterator) {
int version;
- if (!pickle->ReadInt(data_iterator, &version))
+ if (!data_iterator->ReadInt(&version))
return false;
if (version > kSecureHashVersion)
return false; // We don't know how to deal with this.
std::string type;
- if (!pickle->ReadString(data_iterator, &type))
+ if (!data_iterator->ReadString(&type))
return false;
if (type != kSHA256Descriptor)
return false; // It's the wrong kind.
const char* data = NULL;
- if (!pickle->ReadBytes(data_iterator, &data, sizeof(ctx_)))
+ if (!data_iterator->ReadBytes(&data, sizeof(ctx_)))
return false;
memcpy(&ctx_, data, sizeof(ctx_));
« no previous file with comments | « crypto/secure_hash.h ('k') | crypto/secure_hash_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698