Index: net/base/hash_value.cc |
diff --git a/net/base/hash_value.cc b/net/base/hash_value.cc |
index f72aa454df6e79fca65d1c6528753c434c6f3af5..6b207d92798c3b85617486027befdb5006287ed7 100644 |
--- a/net/base/hash_value.cc |
+++ b/net/base/hash_value.cc |
@@ -30,6 +30,19 @@ bool SHA1HashValue::Equals(const SHA1HashValue& other) const { |
return memcmp(data, other.data, sizeof(data)) == 0; |
} |
+bool SHA1HashValue::Persist(base::Pickle* pickle) const { |
+ return pickle->WriteBytes(data, sizeof(data)); |
+} |
+ |
+bool SHA1HashValue::CreateFromPickle(base::PickleIterator* iter, |
+ SHA1HashValue* hash) { |
+ const char* outdata_char = NULL; |
+ if (!iter->ReadBytes(&outdata_char, sizeof(hash->data))) |
+ return false; |
+ memcpy(&hash->data, outdata_char, sizeof(hash->data)); |
+ return true; |
+} |
+ |
bool SHA256HashValue::Equals(const SHA256HashValue& other) const { |
return memcmp(data, other.data, sizeof(data)) == 0; |
} |