Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(805)

Side by Side Diff: sync/internal_api/sync_rollback_manager_base.cc

Issue 805633004: Enable Null Syncable ID which is different than Root ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "sync/internal_api/public/base/model_type.h" 7 #include "sync/internal_api/public/base/model_type.h"
8 #include "sync/internal_api/public/read_node.h" 8 #include "sync/internal_api/public/read_node.h"
9 #include "sync/internal_api/public/read_transaction.h" 9 #include "sync/internal_api/public/read_transaction.h"
10 #include "sync/internal_api/public/write_transaction.h" 10 #include "sync/internal_api/public/write_transaction.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 if (BaseNode::INIT_OK == root.InitTypeRoot(type)) 263 if (BaseNode::INIT_OK == root.InitTypeRoot(type))
264 return true; 264 return true;
265 265
266 syncable::MutableEntry entry(trans.GetWrappedWriteTrans(), 266 syncable::MutableEntry entry(trans.GetWrappedWriteTrans(),
267 syncable::CREATE_NEW_UPDATE_ITEM, 267 syncable::CREATE_NEW_UPDATE_ITEM,
268 syncable::Id::CreateFromServerId( 268 syncable::Id::CreateFromServerId(
269 ModelTypeToString(type))); 269 ModelTypeToString(type)));
270 if (!entry.good()) 270 if (!entry.good())
271 return false; 271 return false;
272 272
273 entry.PutParentId(syncable::Id()); 273 entry.PutParentId(syncable::Id::GetRoot());
274 entry.PutBaseVersion(1); 274 entry.PutBaseVersion(1);
275 entry.PutUniqueServerTag(ModelTypeToRootTag(type)); 275 entry.PutUniqueServerTag(ModelTypeToRootTag(type));
276 entry.PutNonUniqueName(ModelTypeToString(type)); 276 entry.PutNonUniqueName(ModelTypeToString(type));
277 entry.PutIsDel(false); 277 entry.PutIsDel(false);
278 entry.PutIsDir(true); 278 entry.PutIsDir(true);
279 279
280 sync_pb::EntitySpecifics specifics; 280 sync_pb::EntitySpecifics specifics;
281 AddDefaultFieldValue(type, &specifics); 281 AddDefaultFieldValue(type, &specifics);
282 entry.PutSpecifics(specifics); 282 entry.PutSpecifics(specifics);
283 283
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 void SyncRollbackManagerBase::UnregisterDirectoryTypeDebugInfoObserver( 320 void SyncRollbackManagerBase::UnregisterDirectoryTypeDebugInfoObserver(
321 syncer::TypeDebugInfoObserver* observer) {} 321 syncer::TypeDebugInfoObserver* observer) {}
322 322
323 bool SyncRollbackManagerBase::HasDirectoryTypeDebugInfoObserver( 323 bool SyncRollbackManagerBase::HasDirectoryTypeDebugInfoObserver(
324 syncer::TypeDebugInfoObserver* observer) { return false; } 324 syncer::TypeDebugInfoObserver* observer) { return false; }
325 325
326 void SyncRollbackManagerBase::RequestEmitDebugInfo() {} 326 void SyncRollbackManagerBase::RequestEmitDebugInfo() {}
327 327
328 } // namespace syncer 328 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | sync/internal_api/test/test_entry_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698