Index: base/pickle.h |
diff --git a/base/pickle.h b/base/pickle.h |
index 02bc432ad0bd27564e289f9d8fae0b9ca9408241..7fb680614e843077fc9b9d18d803ca6d54e4627d 100644 |
--- a/base/pickle.h |
+++ b/base/pickle.h |
@@ -173,13 +173,10 @@ class BASE_EXPORT Pickle { |
bool WriteInt(int value) { |
return WritePOD(value); |
} |
- // WARNING: DO NOT USE THIS METHOD IF PICKLES ARE PERSISTED IN ANY WAY. |
- // It will write whatever a "long" is on this architecture. On 32-bit |
- // platforms, it is 32 bits. On 64-bit platforms, it is 64 bits. If persisted |
- // pickles are still around after upgrading to 64-bit, or if they are copied |
- // between dissimilar systems, YOUR PICKLES WILL HAVE GONE BAD. |
- bool WriteLongUsingDangerousNonPortableLessPersistableForm(long value) { |
- return WritePOD(value); |
+ bool WriteLong(long value) { |
+ // Always write long as a 64-bit value to ensure compatibility between |
+ // 32-bit and 64-bit processes. |
+ return WritePOD(static_cast<int64_t>(value)); |
} |
bool WriteUInt16(uint16_t value) { return WritePOD(value); } |
bool WriteUInt32(uint32_t value) { return WritePOD(value); } |