Chromium Code Reviews| Index: base/pickle.h |
| =================================================================== |
| --- base/pickle.h (revision 127523) |
| +++ base/pickle.h (working copy) |
| @@ -31,7 +31,6 @@ |
| bool ReadBool(bool* result) WARN_UNUSED_RESULT; |
| bool ReadInt(int* result) WARN_UNUSED_RESULT; |
| bool ReadLong(long* result) WARN_UNUSED_RESULT; |
| - bool ReadSize(size_t* result) WARN_UNUSED_RESULT; |
| bool ReadUInt16(uint16* result) WARN_UNUSED_RESULT; |
| bool ReadUInt32(uint32* result) WARN_UNUSED_RESULT; |
| bool ReadInt64(int64* result) WARN_UNUSED_RESULT; |
| @@ -148,9 +147,6 @@ |
| bool ReadLong(PickleIterator* iter, long* result) const { |
| return iter->ReadLong(result); |
| } |
| - bool ReadSize(PickleIterator* iter, size_t* result) const { |
| - return iter->ReadSize(result); |
| - } |
| bool ReadUInt16(PickleIterator* iter, uint16* result) const { |
| return iter->ReadUInt16(result); |
| } |
| @@ -195,12 +191,14 @@ |
| bool WriteInt(int value) { |
| return WriteBytes(&value, sizeof(value)); |
| } |
| + // WARNING: DO NOT USE WriteLong() IF PICKLES ARE PERSISTED IN ANY WAY. |
| + // WriteLong() writes 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. |
|
jar (doing other things)
2012/03/22 21:08:57
How about changing the name to something that clar
Mike Mammarella
2012/03/22 21:30:52
I took a look and it turns out that WriteLong() is
|
| bool WriteLong(long value) { |
| return WriteBytes(&value, sizeof(value)); |
| } |
| - bool WriteSize(size_t value) { |
| - return WriteBytes(&value, sizeof(value)); |
| - } |
| bool WriteUInt16(uint16 value) { |
| return WriteBytes(&value, sizeof(value)); |
| } |