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

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

Issue 8637006: [Sync] Make syncer commands avoid posting tasks on threads with no work to do (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head, fix windows compile Created 9 years 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/sessions/sync_session_unittest.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 64c518bb007adf02ee2dfc4b3644e1effb9a0227..73e71d5c1460cfa76d2068364e733c09677d83a3 100644
--- a/chrome/browser/sync/syncable/syncable.h
+++ b/chrome/browser/sync/syncable/syncable.h
@@ -371,6 +371,8 @@ struct EntryKernel {
return id_fields[field - ID_FIELDS_BEGIN];
}
+ syncable::ModelType GetServerModelType() const;
+
// Does a case in-sensitive search for a given string, which must be
// lower case.
bool ContainsString(const std::string& lowercase_query) const;
@@ -487,9 +489,6 @@ class Entry {
EntryKernel* kernel_;
private:
- // Like GetServerModelType() but without the DCHECKs.
- ModelType GetServerModelTypeHelper() const;
-
DISALLOW_COPY_AND_ASSIGN(Entry);
};
@@ -969,9 +968,17 @@ class Directory {
void GetUnsyncedMetaHandles(BaseTransaction* trans,
UnsyncedMetaHandles* result);
- // Get all the metahandles for unapplied updates
+ // Returns all server types with unapplied updates. A subset of
+ // those types can then be passed into
+ // GetUnappliedUpdateMetaHandles() below.
+ syncable::ModelTypeBitSet GetServerTypesWithUnappliedUpdates(
+ BaseTransaction* trans) const;
+
+ // Get all the metahandles for unapplied updates for a given set of
+ // server types.
typedef std::vector<int64> UnappliedUpdateMetaHandles;
void GetUnappliedUpdateMetaHandles(BaseTransaction* trans,
+ syncable::ModelTypeBitSet server_types,
UnappliedUpdateMetaHandles* result);
// Checks tree metadata consistency.
@@ -1103,7 +1110,8 @@ class Directory {
EntryKernel needle;
// 3 in-memory indices on bits used extremely frequently by the syncer.
- MetahandleSet* const unapplied_update_metahandles;
+ // |unapplied_update_metahandles| is keyed by the server model type.
+ MetahandleSet unapplied_update_metahandles[MODEL_TYPE_COUNT];
MetahandleSet* const unsynced_metahandles;
// Contains metahandles that are most likely dirty (though not
// necessarily). Dirtyness is confirmed in TakeSnapshotForSaveChanges().
« no previous file with comments | « chrome/browser/sync/sessions/sync_session_unittest.cc ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698