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

Unified Diff: components/sync/syncable/entry_kernel.h

Issue 2292393004: Remove stl_util from sync. (Closed)
Patch Set: rebase Created 4 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
Index: components/sync/syncable/entry_kernel.h
diff --git a/components/sync/syncable/entry_kernel.h b/components/sync/syncable/entry_kernel.h
index fb4208aec76bbfe46efef816088b3c4b4000498a..82a58988864e4be3788ef8c9e71a3a41fd65686a 100644
--- a/components/sync/syncable/entry_kernel.h
+++ b/components/sync/syncable/entry_kernel.h
@@ -382,16 +382,23 @@ struct EntryKernel {
bool dirty_;
};
+template <typename T>
class EntryKernelLessByMetaHandle {
public:
- inline bool operator()(const EntryKernel* a, const EntryKernel* b) const {
+ inline bool operator()(T a, T b) const {
return a->ref(META_HANDLE) < b->ref(META_HANDLE);
}
};
-typedef std::set<const EntryKernel*, EntryKernelLessByMetaHandle>
+typedef std::set<const EntryKernel*,
+ EntryKernelLessByMetaHandle<const EntryKernel*>>
EntryKernelSet;
+typedef std::set<
+ std::unique_ptr<EntryKernel>,
+ EntryKernelLessByMetaHandle<const std::unique_ptr<EntryKernel>&>>
+ OwnedEntryKernelSet;
+
struct EntryKernelMutation {
EntryKernel original, mutated;
};

Powered by Google App Engine
This is Rietveld 408576698