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

Unified Diff: components/sync_driver/non_blocking_data_type_manager.cc

Issue 1096983002: Update usages of std::map to use ScopedPtrMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@passwordmanager-scopedmemory
Patch Set: Rebase. Created 5 years, 6 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 | « components/sync_driver/non_blocking_data_type_manager.h ('k') | media/midi/midi_manager_alsa.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/non_blocking_data_type_manager.cc
diff --git a/components/sync_driver/non_blocking_data_type_manager.cc b/components/sync_driver/non_blocking_data_type_manager.cc
index 9aa8aac2e983ca67f81ff49181674449c1b099d9..391077fc4cc4133cc937f5ce7cf6a6c6f4891765 100644
--- a/components/sync_driver/non_blocking_data_type_manager.cc
+++ b/components/sync_driver/non_blocking_data_type_manager.cc
@@ -10,11 +10,11 @@
namespace sync_driver {
-NonBlockingDataTypeManager::NonBlockingDataTypeManager()
- : non_blocking_data_type_controllers_deleter_(
- &non_blocking_data_type_controllers_) {}
+NonBlockingDataTypeManager::NonBlockingDataTypeManager() {
+}
-NonBlockingDataTypeManager::~NonBlockingDataTypeManager() {}
+NonBlockingDataTypeManager::~NonBlockingDataTypeManager() {
+}
void NonBlockingDataTypeManager::RegisterType(
syncer::ModelType type,
@@ -22,18 +22,15 @@ void NonBlockingDataTypeManager::RegisterType(
DCHECK_EQ(0U, non_blocking_data_type_controllers_.count(type))
<< "Duplicate registration of type " << ModelTypeToString(type);
- non_blocking_data_type_controllers_.insert(std::make_pair(
- type,
- new NonBlockingDataTypeController(
- type,
- enabled)));
+ non_blocking_data_type_controllers_.insert(
+ type, make_scoped_ptr(new NonBlockingDataTypeController(type, enabled)));
}
void NonBlockingDataTypeManager::InitializeType(
syncer::ModelType type,
const scoped_refptr<base::SequencedTaskRunner>& task_runner,
const base::WeakPtr<syncer::ModelTypeSyncProxyImpl>& proxy_impl) {
- NonBlockingDataTypeControllerMap::iterator it =
+ NonBlockingDataTypeControllerMap::const_iterator it =
non_blocking_data_type_controllers_.find(type);
DCHECK(it != non_blocking_data_type_controllers_.end());
it->second->InitializeType(task_runner, proxy_impl);
@@ -41,16 +38,16 @@ void NonBlockingDataTypeManager::InitializeType(
void NonBlockingDataTypeManager::ConnectSyncBackend(
scoped_ptr<syncer::SyncContextProxy> proxy) {
- for (NonBlockingDataTypeControllerMap::iterator it =
- non_blocking_data_type_controllers_.begin();
+ for (NonBlockingDataTypeControllerMap::const_iterator it =
+ non_blocking_data_type_controllers_.begin();
it != non_blocking_data_type_controllers_.end(); ++it) {
it->second->InitializeSyncContext(proxy->Clone());
}
}
void NonBlockingDataTypeManager::DisconnectSyncBackend() {
- for (NonBlockingDataTypeControllerMap::iterator it =
- non_blocking_data_type_controllers_.begin();
+ for (NonBlockingDataTypeControllerMap::const_iterator it =
+ non_blocking_data_type_controllers_.begin();
it != non_blocking_data_type_controllers_.end(); ++it) {
it->second->ClearSyncContext();
}
@@ -58,8 +55,8 @@ void NonBlockingDataTypeManager::DisconnectSyncBackend() {
void NonBlockingDataTypeManager::SetPreferredTypes(
syncer::ModelTypeSet preferred_types) {
- for (NonBlockingDataTypeControllerMap::iterator it =
- non_blocking_data_type_controllers_.begin();
+ for (NonBlockingDataTypeControllerMap::const_iterator it =
+ non_blocking_data_type_controllers_.begin();
it != non_blocking_data_type_controllers_.end(); ++it) {
it->second->SetIsPreferred(preferred_types.Has(it->first));
}
« no previous file with comments | « components/sync_driver/non_blocking_data_type_manager.h ('k') | media/midi/midi_manager_alsa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698