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

Side by Side Diff: device/bluetooth/bluetooth_device.cc

Issue 1256313002: bluetooth: android: Implement & test CreateGattConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split tests up into smaller tests Created 5 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/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_android.h » ('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 (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.h" 5 #include "device/bluetooth/bluetooth_device.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return false; 203 return false;
204 } 204 }
205 205
206 void BluetoothDevice::CreateGattConnection( 206 void BluetoothDevice::CreateGattConnection(
207 const GattConnectionCallback& callback, 207 const GattConnectionCallback& callback,
208 const ConnectErrorCallback& error_callback) { 208 const ConnectErrorCallback& error_callback) {
209 create_gatt_connection_success_callbacks_.push_back(callback); 209 create_gatt_connection_success_callbacks_.push_back(callback);
210 create_gatt_connection_error_callbacks_.push_back(error_callback); 210 create_gatt_connection_error_callbacks_.push_back(error_callback);
211 211
212 if (IsGattConnected()) 212 if (IsGattConnected())
213 DidConnectGatt(); 213 return DidConnectGatt();
214 214
215 CreateGattConnectionImpl(); 215 CreateGattConnectionImpl();
216 } 216 }
217 217
218 std::vector<BluetoothGattService*> 218 std::vector<BluetoothGattService*>
219 BluetoothDevice::GetGattServices() const { 219 BluetoothDevice::GetGattServices() const {
220 std::vector<BluetoothGattService*> services; 220 std::vector<BluetoothGattService*> services;
221 for (GattServiceMap::const_iterator iter = gatt_services_.begin(); 221 for (GattServiceMap::const_iterator iter = gatt_services_.begin();
222 iter != gatt_services_.end(); ++iter) 222 iter != gatt_services_.end(); ++iter)
223 services.push_back(iter->second); 223 services.push_back(iter->second);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 336
337 void BluetoothDevice::ClearServiceData() { services_data_->Clear(); } 337 void BluetoothDevice::ClearServiceData() { services_data_->Clear(); }
338 338
339 void BluetoothDevice::SetServiceData(BluetoothUUID serviceUUID, 339 void BluetoothDevice::SetServiceData(BluetoothUUID serviceUUID,
340 const char* buffer, size_t size) { 340 const char* buffer, size_t size) {
341 services_data_->Set(serviceUUID.value(), 341 services_data_->Set(serviceUUID.value(),
342 base::BinaryValue::CreateWithCopiedBuffer(buffer, size)); 342 base::BinaryValue::CreateWithCopiedBuffer(buffer, size));
343 } 343 }
344 344
345 } // namespace device 345 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | device/bluetooth/bluetooth_device_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698