OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/model_neutral_mutable_entry.h" | 5 #include "sync/syncable/model_neutral_mutable_entry.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "sync/internal_api/public/base/unique_position.h" | 9 #include "sync/internal_api/public/base/unique_position.h" |
10 #include "sync/syncable/directory.h" | 10 #include "sync/syncable/directory.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 trans->TrackChangesTo(kernel.get()); | 42 trans->TrackChangesTo(kernel.get()); |
43 | 43 |
44 kernel_ = kernel.release(); | 44 kernel_ = kernel.release(); |
45 } | 45 } |
46 | 46 |
47 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans, | 47 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans, |
48 CreateNewTypeRoot, | 48 CreateNewTypeRoot, |
49 ModelType type) | 49 ModelType type) |
50 : Entry(trans), base_write_transaction_(trans) { | 50 : Entry(trans), base_write_transaction_(trans) { |
51 DCHECK(!IsTypeWithServerGeneratedRoot(type)); | 51 DCHECK(IsTypeWithClientGeneratedRoot(type)); |
52 Entry same_type_root(trans, GET_TYPE_ROOT, type); | 52 Entry same_type_root(trans, GET_TYPE_ROOT, type); |
53 kernel_ = NULL; | 53 kernel_ = NULL; |
54 if (same_type_root.good()) { | 54 if (same_type_root.good()) { |
55 return; // already have a type root for the given type | 55 return; // already have a type root for the given type |
56 } | 56 } |
57 | 57 |
58 scoped_ptr<EntryKernel> kernel(new EntryKernel()); | 58 scoped_ptr<EntryKernel> kernel(new EntryKernel()); |
59 | 59 |
60 sync_pb::EntitySpecifics specifics; | 60 sync_pb::EntitySpecifics specifics; |
61 AddDefaultFieldValue(type, &specifics); | 61 AddDefaultFieldValue(type, &specifics); |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans) | 420 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans) |
421 : Entry(trans), base_write_transaction_(trans) {} | 421 : Entry(trans), base_write_transaction_(trans) {} |
422 | 422 |
423 MetahandleSet* ModelNeutralMutableEntry::GetDirtyIndexHelper() { | 423 MetahandleSet* ModelNeutralMutableEntry::GetDirtyIndexHelper() { |
424 return &dir()->kernel_->dirty_metahandles; | 424 return &dir()->kernel_->dirty_metahandles; |
425 } | 425 } |
426 | 426 |
427 } // namespace syncable | 427 } // namespace syncable |
428 | 428 |
429 } // namespace syncer | 429 } // namespace syncer |
OLD | NEW |