diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-26 21:59:19 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-26 21:59:19 +0000 |
commit | 9da02fdb172d447777aba9cda8a17362eff0635a (patch) | |
tree | 9bed06920136484ba9ab9212cc2a12181b5630f8 /sync/syncable/syncable_util.cc | |
parent | 8f7c1f76f82d5469869417b01b0b21989b926826 (diff) | |
download | chromium_src-9da02fdb172d447777aba9cda8a17362eff0635a.zip chromium_src-9da02fdb172d447777aba9cda8a17362eff0635a.tar.gz chromium_src-9da02fdb172d447777aba9cda8a17362eff0635a.tar.bz2 |
sync: Process commit responses on the sync thread
Convert ProcessCommitResponseCommand from a ModelChangingSyncerCommand
to a regular SyncerCommand. This means that it will be executed
entirely on the sync thread, rather than having its work delegated to
the native model threads.
This is built on top of the recent ModelNeutralWriteTransaction and
ModelNeutralMutableEntry work. In order to ensure that no
model-changing mutations are performed while processing the commit
response, and to prevent future code changes from introducing them, the
ProcessCommitResponseCommand's methods have been converted to use
ModelNeutral transactions only.
The use of ModelNeutral transactions and non-ModelChanging
SyncerCommands should grant some minor performance improvements and make
the code simpler.
BUG=284672
Review URL: https://codereview.chromium.org/24764004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225585 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/syncable/syncable_util.cc')
-rw-r--r-- | sync/syncable/syncable_util.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sync/syncable/syncable_util.cc b/sync/syncable/syncable_util.cc index 05cc2a9..74ae06a 100644 --- a/sync/syncable/syncable_util.cc +++ b/sync/syncable/syncable_util.cc @@ -47,8 +47,8 @@ bool IsLegalNewParent(BaseTransaction* trans, const Id& entry_id, } void ChangeEntryIDAndUpdateChildren( - WriteTransaction* trans, - MutableEntry* entry, + BaseWriteTransaction* trans, + ModelNeutralMutableEntry* entry, const Id& new_id) { Id old_id = entry->GetId(); if (!entry->PutId(new_id)) { @@ -64,7 +64,7 @@ void ChangeEntryIDAndUpdateChildren( trans->directory()->GetChildHandlesById(trans, old_id, &children); Directory::Metahandles::iterator i = children.begin(); while (i != children.end()) { - MutableEntry child_entry(trans, GET_BY_HANDLE, *i++); + ModelNeutralMutableEntry child_entry(trans, GET_BY_HANDLE, *i++); CHECK(child_entry.good()); // Use the unchecked setter here to avoid touching the child's // UNIQUE_POSITION field. In this case, UNIQUE_POSITION among the |