diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-09 19:20:05 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-09 19:20:05 +0000 |
commit | 8c996fc152cc5de0a2a1e573d339b668115cdd00 (patch) | |
tree | 9058023fd6a16173ef5ac7d8295030bb8045853b | |
parent | c096a9f63cf2af44f764d7de3d2cab4dcf592063 (diff) | |
download | chromium_src-8c996fc152cc5de0a2a1e573d339b668115cdd00.zip chromium_src-8c996fc152cc5de0a2a1e573d339b668115cdd00.tar.gz chromium_src-8c996fc152cc5de0a2a1e573d339b668115cdd00.tar.bz2 |
Speculative fix for bug 37709. Don't use a MutableEntry (and hence add something to the transaction's originals_ array) in apply updates until we know it's a safe type.
BUG=37709,36822
Review URL: http://codereview.chromium.org/705001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41065 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/engine/update_applicator.cc | 7 | ||||
-rw-r--r-- | chrome/browser/sync/engine/update_applicator.h | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/sync/engine/update_applicator.cc b/chrome/browser/sync/engine/update_applicator.cc index 268de4c..bcab9d4 100644 --- a/chrome/browser/sync/engine/update_applicator.cc +++ b/chrome/browser/sync/engine/update_applicator.cc @@ -50,13 +50,14 @@ bool UpdateApplicator::AttemptOneApplication( // Clear the tracked failures to avoid double-counting. conflicting_ids_.clear(); } - syncable::MutableEntry entry(trans, syncable::GET_BY_HANDLE, *pointer_); - if (SkipUpdate(entry)) { + syncable::Entry read_only(trans, syncable::GET_BY_HANDLE, *pointer_); + if (SkipUpdate(read_only)) { Advance(); return true; } + syncable::MutableEntry entry(trans, syncable::GET_BY_HANDLE, *pointer_); UpdateAttemptResponse updateResponse = SyncerUtil::AttemptToUpdateEntry(trans, &entry, resolver_); switch (updateResponse) { @@ -84,7 +85,7 @@ void UpdateApplicator::Advance() { *pointer_ = *end_; } -bool UpdateApplicator::SkipUpdate(const syncable::MutableEntry& entry) { +bool UpdateApplicator::SkipUpdate(const syncable::Entry& entry) { ModelSafeGroup g = GetGroupForModelType(entry.GetServerModelType(), routing_info_); if (g != group_filter_) diff --git a/chrome/browser/sync/engine/update_applicator.h b/chrome/browser/sync/engine/update_applicator.h index 7a412e8..7073f0a 100644 --- a/chrome/browser/sync/engine/update_applicator.h +++ b/chrome/browser/sync/engine/update_applicator.h @@ -54,7 +54,7 @@ class UpdateApplicator { private: // If true, AttemptOneApplication will skip over |entry| and return true. - bool SkipUpdate(const syncable::MutableEntry& entry); + bool SkipUpdate(const syncable::Entry& entry); // Adjusts the UpdateIterator members to move ahead by one update. void Advance(); |