| OLD | NEW | 
|   1 // Copyright 2014 The Chromium Authors. All rights reserved. |   1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
|   2 // Use of this source code is governed by a BSD-style license that can be |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4  |   4  | 
|   5 #include "sync/syncable/deferred_on_disk_directory_backing_store.h" |   5 #include "sync/syncable/deferred_on_disk_directory_backing_store.h" | 
|   6  |   6  | 
|   7 #include "base/logging.h" |   7 #include "base/logging.h" | 
|   8 #include "base/metrics/histogram.h" |   8 #include "base/metrics/histogram.h" | 
|   9 #include "base/stl_util.h" |   9 #include "base/stl_util.h" | 
|  10 #include "sync/syncable/syncable-inl.h" |  10 #include "sync/syncable/syncable-inl.h" | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
|  32     return true; |  32     return true; | 
|  33   } |  33   } | 
|  34  |  34  | 
|  35   if (!db_is_on_disk_) { |  35   if (!db_is_on_disk_) { | 
|  36     if (!base::DeleteFile(backing_filepath_, false)) |  36     if (!base::DeleteFile(backing_filepath_, false)) | 
|  37       return false; |  37       return false; | 
|  38  |  38  | 
|  39     // Reopen DB on disk. |  39     // Reopen DB on disk. | 
|  40     db_.reset(new sql::Connection); |  40     db_.reset(new sql::Connection); | 
|  41     db_->set_exclusive_locking(); |  41     db_->set_exclusive_locking(); | 
|  42     db_->set_page_size(4096); |  42     if (IsSyncBackingDatabase32KEnabled()) { | 
 |  43       db_->set_page_size(32768); | 
 |  44     } else { | 
 |  45       db_->set_page_size(4096); | 
 |  46     } | 
|  43     if (!db_->Open(backing_filepath_) || !InitializeTables()) |  47     if (!db_->Open(backing_filepath_) || !InitializeTables()) | 
|  44       return false; |  48       return false; | 
|  45  |  49  | 
|  46     db_is_on_disk_ = true; |  50     db_is_on_disk_ = true; | 
|  47   } |  51   } | 
|  48  |  52  | 
|  49   return DirectoryBackingStore::SaveChanges(snapshot); |  53   return DirectoryBackingStore::SaveChanges(snapshot); | 
|  50 } |  54 } | 
|  51  |  55  | 
|  52 DirOpenResult DeferredOnDiskDirectoryBackingStore::Load( |  56 DirOpenResult DeferredOnDiskDirectoryBackingStore::Load( | 
| (...skipping 11 matching lines...) Expand all  Loading... | 
|  64   if (!LoadEntries(handles_map)) |  68   if (!LoadEntries(handles_map)) | 
|  65     return FAILED_DATABASE_CORRUPT; |  69     return FAILED_DATABASE_CORRUPT; | 
|  66   if (!LoadInfo(kernel_load_info)) |  70   if (!LoadInfo(kernel_load_info)) | 
|  67     return FAILED_DATABASE_CORRUPT; |  71     return FAILED_DATABASE_CORRUPT; | 
|  68  |  72  | 
|  69   return OPENED; |  73   return OPENED; | 
|  70 } |  74 } | 
|  71  |  75  | 
|  72 }  // namespace syncable |  76 }  // namespace syncable | 
|  73 }  // namespace syncer |  77 }  // namespace syncer | 
| OLD | NEW |