Chromium Code Reviews| Index: base/pickle.h |
| =================================================================== |
| --- base/pickle.h (revision 125321) |
| +++ base/pickle.h (working copy) |
| @@ -98,9 +98,15 @@ |
| 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/09 22:13:36
IMO, you have discovered a problem.... and it is a
Mike Mammarella
2012/03/10 00:24:42
Looks like WriteSize() might be feasible to remove
|
| bool WriteLong(long value) { |
| return WriteBytes(&value, sizeof(value)); |
| } |
| + // WARNING: SEE THE WARNING FOR WriteLong() ABOVE. USE WriteSize() CAREFULLY. |
| bool WriteSize(size_t value) { |
| return WriteBytes(&value, sizeof(value)); |
| } |