| 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/internal_api/sync_rollback_manager_base.h" | 5 #include "sync/internal_api/sync_rollback_manager_base.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "sync/internal_api/public/base/model_type.h" | 9 #include "sync/internal_api/public/base/model_type.h" |
| 10 #include "sync/internal_api/public/read_node.h" | 10 #include "sync/internal_api/public/read_node.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 MakeWeakHandle(base::WeakPtr<DataTypeDebugInfoListener>()), | 211 MakeWeakHandle(base::WeakPtr<DataTypeDebugInfoListener>()), |
| 212 false, ModelTypeSet())); | 212 false, ModelTypeSet())); |
| 213 } | 213 } |
| 214 | 214 |
| 215 syncer_v2::SyncContextProxy* SyncRollbackManagerBase::GetSyncContextProxy() { | 215 syncer_v2::SyncContextProxy* SyncRollbackManagerBase::GetSyncContextProxy() { |
| 216 return NULL; | 216 return NULL; |
| 217 } | 217 } |
| 218 | 218 |
| 219 ScopedVector<syncer::ProtocolEvent> | 219 ScopedVector<syncer::ProtocolEvent> |
| 220 SyncRollbackManagerBase::GetBufferedProtocolEvents() { | 220 SyncRollbackManagerBase::GetBufferedProtocolEvents() { |
| 221 return ScopedVector<syncer::ProtocolEvent>().Pass(); | 221 return ScopedVector<syncer::ProtocolEvent>(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 scoped_ptr<base::ListValue> SyncRollbackManagerBase::GetAllNodesForType( | 224 scoped_ptr<base::ListValue> SyncRollbackManagerBase::GetAllNodesForType( |
| 225 syncer::ModelType type) { | 225 syncer::ModelType type) { |
| 226 ReadTransaction trans(FROM_HERE, GetUserShare()); | 226 ReadTransaction trans(FROM_HERE, GetUserShare()); |
| 227 scoped_ptr<base::ListValue> nodes( | 227 scoped_ptr<base::ListValue> nodes( |
| 228 trans.GetDirectory()->GetNodeDetailsForType(trans.GetWrappedTrans(), | 228 trans.GetDirectory()->GetNodeDetailsForType(trans.GetWrappedTrans(), |
| 229 type)); | 229 type)); |
| 230 return nodes.Pass(); | 230 return nodes; |
| 231 } | 231 } |
| 232 | 232 |
| 233 bool SyncRollbackManagerBase::InitBackupDB( | 233 bool SyncRollbackManagerBase::InitBackupDB( |
| 234 const base::FilePath& sync_folder, | 234 const base::FilePath& sync_folder, |
| 235 InternalComponentsFactory* internal_components_factory, | 235 InternalComponentsFactory* internal_components_factory, |
| 236 InternalComponentsFactory::StorageOption storage) { | 236 InternalComponentsFactory::StorageOption storage) { |
| 237 base::FilePath backup_db_path = sync_folder.Append( | 237 base::FilePath backup_db_path = sync_folder.Append( |
| 238 syncable::Directory::kSyncDatabaseFilename); | 238 syncable::Directory::kSyncDatabaseFilename); |
| 239 scoped_ptr<syncable::DirectoryBackingStore> backing_store = | 239 scoped_ptr<syncable::DirectoryBackingStore> backing_store = |
| 240 internal_components_factory->BuildDirectoryBackingStore( | 240 internal_components_factory->BuildDirectoryBackingStore(storage, "backup", |
| 241 storage, "backup", backup_db_path).Pass(); | 241 backup_db_path); |
| 242 | 242 |
| 243 DCHECK(backing_store.get()); | 243 DCHECK(backing_store.get()); |
| 244 share_.directory.reset( | 244 share_.directory.reset( |
| 245 new syncable::Directory( | 245 new syncable::Directory( |
| 246 backing_store.release(), | 246 backing_store.release(), |
| 247 unrecoverable_error_handler_, | 247 unrecoverable_error_handler_, |
| 248 report_unrecoverable_error_function_, | 248 report_unrecoverable_error_function_, |
| 249 NULL, | 249 NULL, |
| 250 NULL)); | 250 NULL)); |
| 251 return syncable::OPENED == | 251 return syncable::OPENED == |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 bool SyncRollbackManagerBase::HasDirectoryTypeDebugInfoObserver( | 321 bool SyncRollbackManagerBase::HasDirectoryTypeDebugInfoObserver( |
| 322 syncer::TypeDebugInfoObserver* observer) { return false; } | 322 syncer::TypeDebugInfoObserver* observer) { return false; } |
| 323 | 323 |
| 324 void SyncRollbackManagerBase::RequestEmitDebugInfo() {} | 324 void SyncRollbackManagerBase::RequestEmitDebugInfo() {} |
| 325 | 325 |
| 326 void SyncRollbackManagerBase::ClearServerData( | 326 void SyncRollbackManagerBase::ClearServerData( |
| 327 const ClearServerDataCallback& callback) {} | 327 const ClearServerDataCallback& callback) {} |
| 328 | 328 |
| 329 } // namespace syncer | 329 } // namespace syncer |
| OLD | NEW |