Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2557)

Unified Diff: chrome/browser/sync/syncable/syncable.cc

Issue 7904021: [Sync] Rework SharedValue<T> into Immutable<T> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/syncable/syncable.h ('k') | chrome/browser/sync/syncable/transaction_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/syncable/syncable.cc
diff --git a/chrome/browser/sync/syncable/syncable.cc b/chrome/browser/sync/syncable/syncable.cc
index 2fad69cda50dd534ba180fa2d6d678fbce77d297..700ff57dfbe80ef7e91b733945a39784e0c1060d 100644
--- a/chrome/browser/sync/syncable/syncable.cc
+++ b/chrome/browser/sync/syncable/syncable.cc
@@ -90,24 +90,6 @@ std::string WriterTagToString(WriterTag writer_tag) {
#undef ENUM_CASE
-SharedEntryKernelMutationMap::SharedEntryKernelMutationMap()
- : mutations_(new SharedMutationMap()) {}
-
-SharedEntryKernelMutationMap::SharedEntryKernelMutationMap(
- EntryKernelMutationMap* mutations)
- : mutations_(new SharedMutationMap(mutations)) {}
-
-SharedEntryKernelMutationMap::~SharedEntryKernelMutationMap() {}
-
-const EntryKernelMutationMap& SharedEntryKernelMutationMap::Get() const {
- return mutations_->Get();
-}
-
-void SharedEntryKernelMutationMap::MutationMapTraits::Swap(
- EntryKernelMutationMap* mutations1, EntryKernelMutationMap* mutations2) {
- mutations1->swap(*mutations2);
-}
-
namespace {
DictionaryValue* EntryKernelMutationToValue(
@@ -1228,7 +1210,7 @@ void WriteTransaction::SaveOriginal(const EntryKernel* entry) {
}
}
-SharedEntryKernelMutationMap WriteTransaction::RecordMutations() {
+ImmutableEntryKernelMutationMap WriteTransaction::RecordMutations() {
dirkernel_->transaction_mutex.AssertAcquired();
for (syncable::EntryKernelMutationMap::iterator it = mutations_.begin();
it != mutations_.end(); ++it) {
@@ -1239,11 +1221,11 @@ SharedEntryKernelMutationMap WriteTransaction::RecordMutations() {
}
it->second.mutated = *kernel;
}
- return SharedEntryKernelMutationMap(&mutations_);
+ return ImmutableEntryKernelMutationMap(&mutations_);
}
void WriteTransaction::UnlockAndNotify(
- const SharedEntryKernelMutationMap& mutations) {
+ const ImmutableEntryKernelMutationMap& mutations) {
// Work while transaction mutex is held.
ModelTypeBitSet models_with_changes;
bool has_mutations = !mutations.Get().empty();
@@ -1259,7 +1241,7 @@ void WriteTransaction::UnlockAndNotify(
}
ModelTypeBitSet WriteTransaction::NotifyTransactionChangingAndEnding(
- const SharedEntryKernelMutationMap& mutations) {
+ const ImmutableEntryKernelMutationMap& mutations) {
dirkernel_->transaction_mutex.AssertAcquired();
DCHECK(!mutations.Get().empty());
@@ -1289,7 +1271,7 @@ void WriteTransaction::NotifyTransactionComplete(
}
WriteTransaction::~WriteTransaction() {
- const SharedEntryKernelMutationMap& mutations = RecordMutations();
+ const ImmutableEntryKernelMutationMap& mutations = RecordMutations();
if (OFF != kInvariantCheckLevel) {
const bool full_scan = (FULL_DB_VERIFICATION == kInvariantCheckLevel);
« no previous file with comments | « chrome/browser/sync/syncable/syncable.h ('k') | chrome/browser/sync/syncable/transaction_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698