Index: base/pickle.cc |
diff --git a/base/pickle.cc b/base/pickle.cc |
index 2d7a051b20077e20d86346867f414cb3ab961ea6..a0933fb7b91ce469f403225614afca3db6384c6e 100644 |
--- a/base/pickle.cc |
+++ b/base/pickle.cc |
@@ -106,6 +106,15 @@ bool PickleIterator::ReadUInt64(uint64* result) { |
return ReadBuiltinType(result); |
} |
+bool PickleIterator::ReadSizeT(size_t* result) { |
+ // Always read size_t as a 64-bit value to ensure compatibility between 32-bit |
+ // and 64-bit processes. |
+ uint64 result_uint64 = 0; |
+ bool success = ReadBuiltinType(&result_uint64); |
+ *result = static_cast<size_t>(result_uint64); |
Tom Sepez
2014/10/01 19:12:45
I'd be OK with this so long as we did a check that
Peter Kasting
2014/10/01 19:42:08
Sure. Changed static_cast to checked_cast to achi
|
+ return success; |
+} |
+ |
bool PickleIterator::ReadFloat(float* result) { |
// crbug.com/315213 |
// The source data may not be properly aligned, and unaligned float reads |