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

Unified Diff: chrome/browser/sync/sessions/sync_session.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/status_controller.cc ('k') | chrome/browser/sync/sessions/sync_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sessions/sync_session.h
diff --git a/chrome/browser/sync/sessions/sync_session.h b/chrome/browser/sync/sessions/sync_session.h
index 2762057568e5c32c0481b72d0c2b9459e5da47b9..135e6d74083cb28f2f1979d2da9032f70a31e5ab 100644
--- a/chrome/browser/sync/sessions/sync_session.h
+++ b/chrome/browser/sync/sessions/sync_session.h
@@ -16,6 +16,7 @@
#pragma once
#include <map>
+#include <set>
#include <string>
#include <utility>
#include <vector>
@@ -119,7 +120,7 @@ class SyncSession {
// session. Purges types from the above 3 which are not in session. Useful
// to update the sync session when the user has disabled some types from
// syncing.
- void RebaseRoutingInfoWithLatest(SyncSession* session);
+ void RebaseRoutingInfoWithLatest(const SyncSession& session);
// Should be called any time |this| is being re-used in a new call to
// SyncShare (e.g., HasMoreToSync returned true).
@@ -152,6 +153,15 @@ class SyncSession {
const ModelSafeRoutingInfo& routing_info() const { return routing_info_; }
const SyncSourceInfo& source() const { return source_; }
+ // Returns the set of groups which have enabled types.
+ const std::set<ModelSafeGroup>& GetEnabledGroups() const;
+
+ // Returns the set of enabled groups that have conflicts.
+ std::set<ModelSafeGroup> GetEnabledGroupsWithConflicts() const;
+
+ // Returns the set of enabled groups that have verified updates.
+ std::set<ModelSafeGroup> GetEnabledGroupsWithVerifiedUpdates() const;
+
private:
// Extend the encapsulation boundary to utilities for internal member
// assignments. This way, the scope of these actions is explicit, they can't
@@ -171,7 +181,7 @@ class SyncSession {
syncable::WriteTransaction* write_transaction_;
// The delegate for this session, must never be NULL.
- Delegate* delegate_;
+ Delegate* const delegate_;
// Our controller for various status and error counters.
scoped_ptr<StatusController> status_controller_;
@@ -185,6 +195,10 @@ class SyncSession {
// on those datatypes.
ModelSafeRoutingInfo routing_info_;
+ // The set of groups with enabled types. Computed from
+ // |routing_info_|.
+ std::set<ModelSafeGroup> enabled_groups_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSession);
};
« no previous file with comments | « chrome/browser/sync/sessions/status_controller.cc ('k') | chrome/browser/sync/sessions/sync_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698