Chromium Code Reviews| Index: sync/syncable/directory.cc |
| diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc |
| index 9348338925f114f2e8052c7323fc4f30bebf0255..1ba8abd94147362ece6dda92a7aed943ac4222f0 100644 |
| --- a/sync/syncable/directory.cc |
| +++ b/sync/syncable/directory.cc |
| @@ -204,6 +204,15 @@ DirOpenResult Directory::OpenImpl( |
| kernel_ = new Kernel(name, info, delegate, transaction_observer); |
| kernel_->metahandles_index->swap(metas_bucket); |
| InitializeIndices(); |
| + |
| + // Write back the share info to reserve some space in 'next_id'. This will |
| + // prevent local ID reuse in the case of an early crash. See the comments in |
| + // TakeSnapshotForSaveChanges() or crbug.com/142987 for more information. |
| + kernel_->info_status = KERNEL_SHARE_INFO_DIRTY; |
| + if (!SaveChanges()) { |
|
Nicolas Zea
2012/08/17 18:09:27
nit: remove curly braces
|
| + return FAILED_INITIAL_WRITE; |
| + } |
| + |
| return OPENED; |
| } |