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

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

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/js/js_transaction_observer.cc ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/syncable/syncable.h
diff --git a/chrome/browser/sync/syncable/syncable.h b/chrome/browser/sync/syncable/syncable.h
index 1f706eb60aedf4682e60c66dd4054a7c4863a681..e0fbe1d060cef2b1768b474214c277def288b5ef 100644
--- a/chrome/browser/sync/syncable/syncable.h
+++ b/chrome/browser/sync/syncable/syncable.h
@@ -32,7 +32,7 @@
#include "chrome/browser/sync/syncable/syncable_id.h"
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/util/dbgq.h"
-#include "chrome/browser/sync/util/shared_value.h"
+#include "chrome/browser/sync/util/immutable.h"
struct PurgeInfo;
@@ -563,29 +563,8 @@ struct EntryKernelMutation {
};
typedef std::map<int64, EntryKernelMutation> EntryKernelMutationMap;
-// A thread-safe wrapper around an immutable mutation map. Used for
-// passing around mutation maps without incurring lots of copies.
-class SharedEntryKernelMutationMap {
- public:
- SharedEntryKernelMutationMap();
- // Takes over the data in |mutations|, leaving |mutations| empty.
- explicit SharedEntryKernelMutationMap(EntryKernelMutationMap* mutations);
-
- ~SharedEntryKernelMutationMap();
-
- const EntryKernelMutationMap& Get() const;
-
- private:
- struct MutationMapTraits {
- static void Swap(EntryKernelMutationMap* mutations1,
- EntryKernelMutationMap* mutations2);
- };
-
- typedef browser_sync::SharedValue<EntryKernelMutationMap, MutationMapTraits>
- SharedMutationMap;
-
- scoped_refptr<const SharedMutationMap> mutations_;
-};
+typedef browser_sync::Immutable<EntryKernelMutationMap>
+ ImmutableEntryKernelMutationMap;
// Caller owns the return value.
base::ListValue* EntryKernelMutationMapToValue(
@@ -1188,12 +1167,12 @@ class WriteTransaction : public BaseTransaction {
private:
// Clears |mutations_|.
- SharedEntryKernelMutationMap RecordMutations();
+ ImmutableEntryKernelMutationMap RecordMutations();
- void UnlockAndNotify(const SharedEntryKernelMutationMap& mutations);
+ void UnlockAndNotify(const ImmutableEntryKernelMutationMap& mutations);
ModelTypeBitSet NotifyTransactionChangingAndEnding(
- const SharedEntryKernelMutationMap& mutations);
+ const ImmutableEntryKernelMutationMap& mutations);
// Only the original fields are filled in until |RecordMutations()|.
// We use a mutation map instead of a kernel set to avoid copying.
« no previous file with comments | « chrome/browser/sync/js/js_transaction_observer.cc ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698