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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 BaseWriteTransaction* trans, GetByHandle, int64 metahandle) | 53 BaseWriteTransaction* trans, GetByHandle, int64 metahandle) |
54 : Entry(trans, GET_BY_HANDLE, metahandle), base_write_transaction_(trans) { | 54 : Entry(trans, GET_BY_HANDLE, metahandle), base_write_transaction_(trans) { |
55 } | 55 } |
56 | 56 |
57 ModelNeutralMutableEntry::ModelNeutralMutableEntry( | 57 ModelNeutralMutableEntry::ModelNeutralMutableEntry( |
58 BaseWriteTransaction* trans, GetByClientTag, const std::string& tag) | 58 BaseWriteTransaction* trans, GetByClientTag, const std::string& tag) |
59 : Entry(trans, GET_BY_CLIENT_TAG, tag), base_write_transaction_(trans) { | 59 : Entry(trans, GET_BY_CLIENT_TAG, tag), base_write_transaction_(trans) { |
60 } | 60 } |
61 | 61 |
62 ModelNeutralMutableEntry::ModelNeutralMutableEntry( | 62 ModelNeutralMutableEntry::ModelNeutralMutableEntry( |
63 BaseWriteTransaction* trans, GetByServerTag, const string& tag) | 63 BaseWriteTransaction* trans, GetTypeRoot, ModelType type) |
64 : Entry(trans, GET_BY_SERVER_TAG, tag), base_write_transaction_(trans) { | 64 : Entry(trans, GET_TYPE_ROOT, type), base_write_transaction_(trans) { |
65 } | 65 } |
66 | 66 |
67 void ModelNeutralMutableEntry::PutBaseVersion(int64 value) { | 67 void ModelNeutralMutableEntry::PutBaseVersion(int64 value) { |
68 DCHECK(kernel_); | 68 DCHECK(kernel_); |
69 base_write_transaction_->TrackChangesTo(kernel_); | 69 base_write_transaction_->TrackChangesTo(kernel_); |
70 if (kernel_->ref(BASE_VERSION) != value) { | 70 if (kernel_->ref(BASE_VERSION) != value) { |
71 kernel_->put(BASE_VERSION, value); | 71 kernel_->put(BASE_VERSION, value); |
72 kernel_->mark_dirty(&dir()->kernel_->dirty_metahandles); | 72 kernel_->mark_dirty(&dir()->kernel_->dirty_metahandles); |
73 } | 73 } |
74 } | 74 } |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans) | 372 ModelNeutralMutableEntry::ModelNeutralMutableEntry(BaseWriteTransaction* trans) |
373 : Entry(trans), base_write_transaction_(trans) {} | 373 : Entry(trans), base_write_transaction_(trans) {} |
374 | 374 |
375 MetahandleSet* ModelNeutralMutableEntry::GetDirtyIndexHelper() { | 375 MetahandleSet* ModelNeutralMutableEntry::GetDirtyIndexHelper() { |
376 return &dir()->kernel_->dirty_metahandles; | 376 return &dir()->kernel_->dirty_metahandles; |
377 } | 377 } |
378 | 378 |
379 } // namespace syncable | 379 } // namespace syncable |
380 | 380 |
381 } // namespace syncer | 381 } // namespace syncer |
OLD | NEW |