diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-01 20:15:12 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-01 20:15:12 +0000 |
commit | 3e332453aa32dbca036c7e7b252dc7e5b7c55a27 (patch) | |
tree | 6a49ea32e7317f306d44c8fda08e8edf248b9767 /sync/syncable/directory.cc | |
parent | fd6c39e9b18d373bbf58ffe8975206308a3ef5e3 (diff) | |
download | chromium_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/directory.cc')
-rw-r--r-- | sync/syncable/directory.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc index 855d442..85e5107 100644 --- a/sync/syncable/directory.cc +++ b/sync/syncable/directory.cc @@ -343,12 +343,12 @@ EntryKernel* Directory::GetRootEntry() { return GetEntryById(Id()); } -bool Directory::InsertEntry(WriteTransaction* trans, EntryKernel* entry) { +bool Directory::InsertEntry(BaseWriteTransaction* trans, EntryKernel* entry) { ScopedKernelLock lock(this); return InsertEntry(trans, entry, &lock); } -bool Directory::InsertEntry(WriteTransaction* trans, +bool Directory::InsertEntry(BaseWriteTransaction* trans, EntryKernel* entry, ScopedKernelLock* lock) { DCHECK(NULL != lock); |