summaryrefslogtreecommitdiffstats
path: root/sync/syncable/model_neutral_mutable_entry.h
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 20:15:12 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 20:15:12 +0000
commit3e332453aa32dbca036c7e7b252dc7e5b7c55a27 (patch)
tree6a49ea32e7317f306d44c8fda08e8edf248b9767 /sync/syncable/model_neutral_mutable_entry.h
parentfd6c39e9b18d373bbf58ffe8975206308a3ef5e3 (diff)
downloadchromium_src-3e332453aa32dbca036c7e7b252dc7e5b7c55a27.zip
chromium_src-3e332453aa32dbca036c7e7b252dc7e5b7c55a27.tar.gz
chromium_src-3e332453aa32dbca036c7e7b252dc7e5b7c55a27.tar.bz2
sync: Process updates responses on the sync thread
Convert ProcessUpdatesCommand from a ModelChangingSyncerCommand to a SyncerCommand. This means it will be executed only on the syncer thread, rather than delegating to a collection of model threads. In order to ensure this change is safe and will not be broken by future CLs, it converts all transactions used by the ProcessUpdatesCommand into ModelNeutralWriteTransactions. When implemented correctly, this guarantees that no change performed by this command will need to be forwarded to the model threads. This commit adds a constructor to ModelNeutralMutableEntry to allow it to instantiate "update" items. This is safe because these update items can be saved and manipulated inside the sync directory as long as they remain locally IS_DEL. The native models do not need to be made aware of them until this flag is unset when we apply the updates in a later SyncerCommand. BUG=299023 Review URL: https://codereview.chromium.org/24879002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/syncable/model_neutral_mutable_entry.h')
-rw-r--r--sync/syncable/model_neutral_mutable_entry.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sync/syncable/model_neutral_mutable_entry.h b/sync/syncable/model_neutral_mutable_entry.h
index c9f6c8b..e2292e7 100644
--- a/sync/syncable/model_neutral_mutable_entry.h
+++ b/sync/syncable/model_neutral_mutable_entry.h
@@ -16,6 +16,10 @@ namespace syncable {
class BaseWriteTransaction;
+enum CreateNewUpdateItem {
+ CREATE_NEW_UPDATE_ITEM
+};
+
// This Entry includes all the operations one can safely perform on the sync
// thread. In particular, it does not expose setters to make changes that need
// to be communicated to the model (and the model's thread). It is not possible
@@ -23,6 +27,9 @@ class BaseWriteTransaction;
// entry.
class SYNC_EXPORT_PRIVATE ModelNeutralMutableEntry : public Entry {
public:
+ ModelNeutralMutableEntry(BaseWriteTransaction* trans,
+ CreateNewUpdateItem,
+ const Id& id);
ModelNeutralMutableEntry(BaseWriteTransaction* trans, GetByHandle, int64);
ModelNeutralMutableEntry(BaseWriteTransaction* trans, GetById, const Id&);
ModelNeutralMutableEntry(