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

Unified Diff: sync/sessions/sync_session_context.h

Issue 93433006: sync: Introduce ModelTypeRegistry and helpers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory leak in tests Created 6 years, 11 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 | « sync/sessions/model_type_registry_unittest.cc ('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 2e2433e41defcc82d737e5c3a6981e60d34ff951..6303de8bcac87bddc36e77aff9aaa640e8a98c23 100644
--- a/sync/sessions/sync_session_context.h
+++ b/sync/sessions/sync_session_context.h
@@ -15,24 +15,18 @@
#ifndef SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_
#define SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_
-#include <map>
#include <string>
-#include <vector>
-#include "base/stl_util.h"
#include "sync/base/sync_export.h"
-#include "sync/engine/sync_directory_commit_contributor.h"
-#include "sync/engine/sync_directory_update_handler.h"
#include "sync/engine/sync_engine_event.h"
-#include "sync/engine/syncer_types.h"
#include "sync/engine/traffic_recorder.h"
-#include "sync/internal_api/public/engine/model_safe_worker.h"
-#include "sync/protocol/sync.pb.h"
#include "sync/sessions/debug_info_getter.h"
+#include "sync/sessions/model_type_registry.h"
namespace syncer {
class ExtensionsActivity;
+class ModelTypeRegistry;
class ServerConnectionManager;
namespace syncable {
@@ -50,11 +44,11 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
SyncSessionContext(
ServerConnectionManager* connection_manager,
syncable::Directory* directory,
- const std::vector<scoped_refptr<ModelSafeWorker> >& workers,
ExtensionsActivity* extensions_activity,
const std::vector<SyncEngineEventListener*>& listeners,
DebugInfoGetter* debug_info_getter,
TrafficRecorder* traffic_recorder,
+ ModelTypeRegistry* model_type_registry,
bool keystore_encryption_enabled,
bool client_enabled_pre_commit_update_avoidance,
const std::string& invalidator_client_id);
@@ -72,15 +66,7 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
return enabled_types_;
}
- void set_routing_info(const ModelSafeRoutingInfo& routing_info);
-
- UpdateHandlerMap* update_handler_map() {
- return &update_handler_map_;
- }
-
- CommitContributorMap* commit_contributor_map() {
- return &commit_contributor_map_;
- }
+ void SetRoutingInfo(const ModelSafeRoutingInfo& routing_info);
ExtensionsActivity* extensions_activity() {
return extensions_activity_.get();
@@ -142,6 +128,10 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
server_enabled_pre_commit_update_avoidance_ = value;
}
+ ModelTypeRegistry* model_type_registry() {
+ return model_type_registry_;
+ }
+
private:
// Rather than force clients to set and null-out various context members, we
// extend our encapsulation boundary to scoped helpers that take care of this
@@ -157,25 +147,6 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
// 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
- // that problem is to initialize this map in set_routing_info().
- UpdateHandlerMap update_handler_map_;
-
- // Deleter for the |update_handler_map_|.
- STLValueDeleter<UpdateHandlerMap> update_handler_deleter_;
-
- // A map of 'commit contributors', one for each enabled type.
- // This must be kept in sync with the routing info. Our temporary solution to
- // that problem is to initialize this map in set_routing_info().
- CommitContributorMap commit_contributor_map_;
-
- // Deleter for the |commit_contributor_map_|.
- STLValueDeleter<CommitContributorMap> commit_contributor_deleter_;
-
- // The set of ModelSafeWorkers. Used to execute tasks of various threads.
- 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.
scoped_refptr<ExtensionsActivity> extensions_activity_;
@@ -196,6 +167,8 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext {
TrafficRecorder* traffic_recorder_;
+ ModelTypeRegistry* model_type_registry_;
+
// Satus information to be sent up to the server.
sync_pb::ClientStatus client_status_;
« no previous file with comments | « sync/sessions/model_type_registry_unittest.cc ('k') | sync/sessions/sync_session_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698