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 #ifndef COMPONENTS_SYNC_SYNCABLE_SYNCABLE_MODEL_NEUTRAL_WRITE_TRANSACTION_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_SYNCABLE_MODEL_NEUTRAL_WRITE_TRANSACTION_H_ |
6 #define COMPONENTS_SYNC_SYNCABLE_SYNCABLE_MODEL_NEUTRAL_WRITE_TRANSACTION_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_SYNCABLE_MODEL_NEUTRAL_WRITE_TRANSACTION_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/sync/base/sync_export.h" | |
10 #include "components/sync/syncable/metahandle_set.h" | 9 #include "components/sync/syncable/metahandle_set.h" |
11 #include "components/sync/syncable/syncable_base_write_transaction.h" | 10 #include "components/sync/syncable/syncable_base_write_transaction.h" |
12 | 11 |
13 namespace syncer { | 12 namespace syncer { |
14 namespace syncable { | 13 namespace syncable { |
15 | 14 |
16 // A transaction used to instantiate Entries or ModelNeutralMutableEntries. | 15 // A transaction used to instantiate Entries or ModelNeutralMutableEntries. |
17 // | 16 // |
18 // This allows it to be used when making changes to sync entity properties that | 17 // This allows it to be used when making changes to sync entity properties that |
19 // do not need to be kept in sync with the associated native model. | 18 // do not need to be kept in sync with the associated native model. |
20 // | 19 // |
21 // This class differs internally from WriteTransactions in that it does a less | 20 // This class differs internally from WriteTransactions in that it does a less |
22 // good job of tracking and reporting on changes to the entries modified within | 21 // good job of tracking and reporting on changes to the entries modified within |
23 // its scope. This is because its changes do not need to be reported to the | 22 // its scope. This is because its changes do not need to be reported to the |
24 // DirectoryChangeDelegate. | 23 // DirectoryChangeDelegate. |
25 class SYNC_EXPORT ModelNeutralWriteTransaction : public BaseWriteTransaction { | 24 class ModelNeutralWriteTransaction : public BaseWriteTransaction { |
26 public: | 25 public: |
27 ModelNeutralWriteTransaction(const tracked_objects::Location& location, | 26 ModelNeutralWriteTransaction(const tracked_objects::Location& location, |
28 WriterTag writer, | 27 WriterTag writer, |
29 Directory* directory); | 28 Directory* directory); |
30 ~ModelNeutralWriteTransaction() override; | 29 ~ModelNeutralWriteTransaction() override; |
31 | 30 |
32 void TrackChangesTo(const EntryKernel* entry) override; | 31 void TrackChangesTo(const EntryKernel* entry) override; |
33 | 32 |
34 private: | 33 private: |
35 MetahandleSet modified_handles_; | 34 MetahandleSet modified_handles_; |
36 | 35 |
37 DISALLOW_COPY_AND_ASSIGN(ModelNeutralWriteTransaction); | 36 DISALLOW_COPY_AND_ASSIGN(ModelNeutralWriteTransaction); |
38 }; | 37 }; |
39 | 38 |
40 } // namespace syncable | 39 } // namespace syncable |
41 } // namespace syncer | 40 } // namespace syncer |
42 | 41 |
43 #endif // COMPONENTS_SYNC_SYNCABLE_SYNCABLE_MODEL_NEUTRAL_WRITE_TRANSACTION_H_ | 42 #endif // COMPONENTS_SYNC_SYNCABLE_SYNCABLE_MODEL_NEUTRAL_WRITE_TRANSACTION_H_ |
OLD | NEW |