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

Unified Diff: sync/sessions/sync_session_context.h

Issue 72403003: sync: Per-type update application (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + fix typo Created 7 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 | « sync/sessions/sync_session.h ('k') | sync/sessions/sync_session_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/sync_session_context.h
diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h
index d195943686e9068339ce4cecb512fcd157e890d6..5995ab151dbcbba209872310ce532fcfa3030da7 100644
--- a/sync/sessions/sync_session_context.h
+++ b/sync/sessions/sync_session_context.h
@@ -3,15 +3,12 @@
// found in the LICENSE file.
// SyncSessionContext encapsulates the contextual information and engine
-// components specific to a SyncSession. A context is accessible via
-// a SyncSession so that session SyncerCommands and parts of the engine have
-// a convenient way to access other parts. In this way it can be thought of as
-// the surrounding environment for the SyncSession. The components of this
-// environment are either valid or not valid for the entire context lifetime,
-// or they are valid for explicitly scoped periods of time by using Scoped
-// installation utilities found below. This means that the context assumes no
-// ownership whatsoever of any object that was not created by the context
-// itself.
+// components specific to a SyncSession. Unlike the SyncSession, the context
+// can be reused across several sync cycles.
+//
+// The context does not take ownership of its pointer members. It's up to
+// the surrounding classes to ensure those members remain valid while the
+// context is in use.
//
// It can only be used from the SyncerThread.
@@ -70,8 +67,8 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
return directory_;
}
- const ModelSafeRoutingInfo& routing_info() const {
- return routing_info_;
+ ModelTypeSet enabled_types() const {
+ return enabled_types_;
}
void set_routing_info(const ModelSafeRoutingInfo& routing_info);
@@ -84,10 +81,6 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
return &commit_contributor_map_;
}
- const std::vector<scoped_refptr<ModelSafeWorker> >& workers() const {
- return workers_;
- }
-
ExtensionsActivity* extensions_activity() {
return extensions_activity_.get();
}
@@ -159,9 +152,9 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
ServerConnectionManager* const connection_manager_;
syncable::Directory* const directory_;
- // A cached copy of SyncBackendRegistrar's routing info.
- // Must be updated manually when SBR's state is modified.
- ModelSafeRoutingInfo routing_info_;
+ // The set of enabled types. Derrived from the routing info set with
+ // set_routing_info().
+ ModelTypeSet enabled_types_;
// A map of 'update handlers', one for each enabled type.
// This must be kept in sync with the routing info. Our temporary solution to
@@ -180,7 +173,7 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
STLValueDeleter<CommitContributorMap> commit_contributor_deleter_;
// The set of ModelSafeWorkers. Used to execute tasks of various threads.
- std::vector<scoped_refptr<ModelSafeWorker> > workers_;
+ std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker> > workers_;
// We use this to stuff extensions activity into CommitMessages so the server
// can correlate commit traffic with extension-related bookmark mutations.
« no previous file with comments | « sync/sessions/sync_session.h ('k') | sync/sessions/sync_session_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698