| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "device/bluetooth/bluetooth_device_win.h" | 5 #include "device/bluetooth/bluetooth_device_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 if (address_ != device_state.address || name_ != device_state.name || | 82 if (address_ != device_state.address || name_ != device_state.name || |
| 83 bluetooth_class_ != device_state.bluetooth_class || | 83 bluetooth_class_ != device_state.bluetooth_class || |
| 84 visible_ != device_state.visible || | 84 visible_ != device_state.visible || |
| 85 connected_ != device_state.connected || | 85 connected_ != device_state.connected || |
| 86 paired_ != device_state.authenticated) { | 86 paired_ != device_state.authenticated) { |
| 87 return false; | 87 return false; |
| 88 } | 88 } |
| 89 | 89 |
| 90 // Checks service collection | 90 // Checks service collection |
| 91 typedef std::set<BluetoothUUID> UUIDSet; | 91 typedef std::set<BluetoothUUID> UUIDSet; |
| 92 typedef base::ScopedPtrHashMap<std::string, BluetoothServiceRecordWin> | 92 typedef base::ScopedPtrHashMap< |
| 93 ServiceRecordMap; | 93 std::string, scoped_ptr<BluetoothServiceRecordWin>> ServiceRecordMap; |
| 94 | 94 |
| 95 UUIDSet known_services; | 95 UUIDSet known_services; |
| 96 for (UUIDList::const_iterator iter = uuids_.begin(); iter != uuids_.end(); | 96 for (UUIDList::const_iterator iter = uuids_.begin(); iter != uuids_.end(); |
| 97 ++iter) { | 97 ++iter) { |
| 98 known_services.insert((*iter)); | 98 known_services.insert((*iter)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 UUIDSet new_services; | 101 UUIDSet new_services; |
| 102 ServiceRecordMap new_service_records; | 102 ServiceRecordMap new_service_records; |
| 103 for (ScopedVector<BluetoothTaskManagerWin::ServiceRecordState>::const_iterator | 103 for (ScopedVector<BluetoothTaskManagerWin::ServiceRecordState>::const_iterator |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); | 275 for (ServiceRecordList::const_iterator iter = service_record_list_.begin(); |
| 276 iter != service_record_list_.end(); | 276 iter != service_record_list_.end(); |
| 277 ++iter) { | 277 ++iter) { |
| 278 if ((*iter)->uuid() == uuid) | 278 if ((*iter)->uuid() == uuid) |
| 279 return *iter; | 279 return *iter; |
| 280 } | 280 } |
| 281 return NULL; | 281 return NULL; |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace device | 284 } // namespace device |
| OLD | NEW |