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

Side by Side Diff: device/bluetooth/bluez/bluetooth_service_record_bluez.cc

Issue 2302963002: device/bluetooth: Add a helper function to BluetoothServiceRecordBlueZ (Closed)
Patch Set: Rebase on ToT. Created 4 years, 3 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 | « device/bluetooth/bluez/bluetooth_service_record_bluez.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/bluez/bluetooth_service_record_bluez.h" 5 #include "device/bluetooth/bluez/bluetooth_service_record_bluez.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 10
(...skipping 27 matching lines...) Expand all
38 void BluetoothServiceRecordBlueZ::AddRecordEntry( 38 void BluetoothServiceRecordBlueZ::AddRecordEntry(
39 uint16_t id, 39 uint16_t id,
40 const BluetoothServiceAttributeValueBlueZ& value) { 40 const BluetoothServiceAttributeValueBlueZ& value) {
41 auto it = attributes_.find(id); 41 auto it = attributes_.find(id);
42 if (it != attributes_.end()) 42 if (it != attributes_.end())
43 attributes_.erase(it); 43 attributes_.erase(it);
44 attributes_.insert( 44 attributes_.insert(
45 std::pair<uint16_t, BluetoothServiceAttributeValueBlueZ>(id, value)); 45 std::pair<uint16_t, BluetoothServiceAttributeValueBlueZ>(id, value));
46 } 46 }
47 47
48 bool BluetoothServiceRecordBlueZ::IsAttributePresented(uint16_t id) {
49 return attributes_.find(id) != attributes_.end();
50 }
51
48 } // namespace bluez 52 } // namespace bluez
OLDNEW
« no previous file with comments | « device/bluetooth/bluez/bluetooth_service_record_bluez.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698