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

Side by Side Diff: chromeos/dbus/nfc_client_helpers.cc

Issue 2229383003: chromeos: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « chromeos/dbus/fake_shill_service_client.cc ('k') | chromeos/disks/disk_mount_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/nfc_client_helpers.h" 5 #include "chromeos/dbus/nfc_client_helpers.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "dbus/values_util.h" 8 #include "dbus/values_util.h"
9 9
10 namespace chromeos { 10 namespace chromeos {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 object_path_set.insert(object_path_set_iter, object_path); 85 object_path_set.insert(object_path_set_iter, object_path);
86 } 86 }
87 87
88 // Remove all objects that are not in |object_paths|. 88 // Remove all objects that are not in |object_paths|.
89 ObjectMap::const_iterator iter = object_map_.begin(); 89 ObjectMap::const_iterator iter = object_map_.begin();
90 while (iter != object_map_.end()) { 90 while (iter != object_map_.end()) {
91 // It is safe to use a const reference here, as DBusObjectMap::RemoveObject 91 // It is safe to use a const reference here, as DBusObjectMap::RemoveObject
92 // won't access it after the iterator becomes invalidated. 92 // won't access it after the iterator becomes invalidated.
93 const dbus::ObjectPath &object_path = iter->first; 93 const dbus::ObjectPath &object_path = iter->first;
94 ++iter; 94 ++iter;
95 if (!ContainsKey(object_path_set, object_path)) 95 if (!base::ContainsKey(object_path_set, object_path))
96 RemoveObject(object_path); 96 RemoveObject(object_path);
97 } 97 }
98 } 98 }
99 99
100 bool DBusObjectMap::AddObject(const dbus::ObjectPath& object_path) { 100 bool DBusObjectMap::AddObject(const dbus::ObjectPath& object_path) {
101 ObjectMap::iterator iter = object_map_.find(object_path); 101 ObjectMap::iterator iter = object_map_.find(object_path);
102 if (iter != object_map_.end()) 102 if (iter != object_map_.end())
103 return false; 103 return false;
104 104
105 DCHECK(bus_); 105 DCHECK(bus_);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 iter != paths_to_object_maps_.end(); ++iter) { 187 iter != paths_to_object_maps_.end(); ++iter) {
188 DBusObjectMap* object_map = iter->second; 188 DBusObjectMap* object_map = iter->second;
189 delete object_map; 189 delete object_map;
190 } 190 }
191 } 191 }
192 192
193 bool ObjectProxyTree::CreateObjectMap(const dbus::ObjectPath& object_path, 193 bool ObjectProxyTree::CreateObjectMap(const dbus::ObjectPath& object_path,
194 const std::string& service_name, 194 const std::string& service_name,
195 DBusObjectMap::Delegate* delegate, 195 DBusObjectMap::Delegate* delegate,
196 dbus::Bus* bus) { 196 dbus::Bus* bus) {
197 if (ContainsKey(paths_to_object_maps_, object_path)) { 197 if (base::ContainsKey(paths_to_object_maps_, object_path)) {
198 LOG(ERROR) << "Mapping already exists for object path: " 198 LOG(ERROR) << "Mapping already exists for object path: "
199 << object_path.value(); 199 << object_path.value();
200 return false; 200 return false;
201 } 201 }
202 paths_to_object_maps_[object_path] = 202 paths_to_object_maps_[object_path] =
203 new DBusObjectMap(service_name, delegate, bus); 203 new DBusObjectMap(service_name, delegate, bus);
204 return true; 204 return true;
205 } 205 }
206 206
207 void ObjectProxyTree::RemoveObjectMap(const dbus::ObjectPath& object_path) { 207 void ObjectProxyTree::RemoveObjectMap(const dbus::ObjectPath& object_path) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 NfcPropertySet* properties = 244 NfcPropertySet* properties =
245 object_map->GetObjectProperties(object_proxy_path); 245 object_map->GetObjectProperties(object_proxy_path);
246 if (properties) 246 if (properties)
247 return properties; 247 return properties;
248 } 248 }
249 return NULL; 249 return NULL;
250 } 250 }
251 251
252 } // namespace nfc_client_helpers 252 } // namespace nfc_client_helpers
253 } // namespace chromeos 253 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_shill_service_client.cc ('k') | chromeos/disks/disk_mount_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698