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

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

Issue 2608613002: Followup cleanup from the removal of base::ScopedPtrHashMap from device/. (Closed)
Patch Set: fixed reversal Created 3 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_remote_gatt_characteristic_android.h" 5 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
11 #include "base/android/jni_string.h" 11 #include "base/android/jni_string.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/stl_util.h"
16 #include "base/threading/thread_task_runner_handle.h" 17 #include "base/threading/thread_task_runner_handle.h"
17 #include "device/bluetooth/bluetooth_adapter_android.h" 18 #include "device/bluetooth/bluetooth_adapter_android.h"
18 #include "device/bluetooth/bluetooth_remote_gatt_descriptor_android.h" 19 #include "device/bluetooth/bluetooth_remote_gatt_descriptor_android.h"
19 #include "device/bluetooth/bluetooth_remote_gatt_service_android.h" 20 #include "device/bluetooth/bluetooth_remote_gatt_service_android.h"
20 #include "jni/ChromeBluetoothRemoteGattCharacteristic_jni.h" 21 #include "jni/ChromeBluetoothRemoteGattCharacteristic_jni.h"
21 22
22 using base::android::AttachCurrentThread; 23 using base::android::AttachCurrentThread;
23 using base::android::JavaParamRef; 24 using base::android::JavaParamRef;
24 using base::android::JavaRef; 25 using base::android::JavaRef;
25 26
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 JNIEnv* env, 235 JNIEnv* env,
235 const JavaParamRef<jobject>& caller, 236 const JavaParamRef<jobject>& caller,
236 const JavaParamRef<jstring>& instanceId, 237 const JavaParamRef<jstring>& instanceId,
237 const JavaParamRef<jobject>& /* BluetoothGattDescriptorWrapper */ 238 const JavaParamRef<jobject>& /* BluetoothGattDescriptorWrapper */
238 bluetooth_gatt_descriptor_wrapper, 239 bluetooth_gatt_descriptor_wrapper,
239 const JavaParamRef<jobject>& /* ChromeBluetoothDevice */ 240 const JavaParamRef<jobject>& /* ChromeBluetoothDevice */
240 chrome_bluetooth_device) { 241 chrome_bluetooth_device) {
241 std::string instanceIdString = 242 std::string instanceIdString =
242 base::android::ConvertJavaStringToUTF8(env, instanceId); 243 base::android::ConvertJavaStringToUTF8(env, instanceId);
243 244
244 DCHECK(descriptors_.find(instanceIdString) == descriptors_.end()); 245 DCHECK(!base::ContainsKey(descriptors_, instanceIdString));
245 246
246 descriptors_[instanceIdString] = BluetoothRemoteGattDescriptorAndroid::Create( 247 descriptors_[instanceIdString] = BluetoothRemoteGattDescriptorAndroid::Create(
247 instanceIdString, bluetooth_gatt_descriptor_wrapper, 248 instanceIdString, bluetooth_gatt_descriptor_wrapper,
248 chrome_bluetooth_device); 249 chrome_bluetooth_device);
249 } 250 }
250 251
251 void BluetoothRemoteGattCharacteristicAndroid::SubscribeToNotifications( 252 void BluetoothRemoteGattCharacteristicAndroid::SubscribeToNotifications(
252 BluetoothRemoteGattDescriptor* ccc_descriptor, 253 BluetoothRemoteGattDescriptor* ccc_descriptor,
253 const base::Closure& callback, 254 const base::Closure& callback,
254 const ErrorCallback& error_callback) { 255 const ErrorCallback& error_callback) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 void BluetoothRemoteGattCharacteristicAndroid::EnsureDescriptorsCreated() 299 void BluetoothRemoteGattCharacteristicAndroid::EnsureDescriptorsCreated()
299 const { 300 const {
300 if (!descriptors_.empty()) 301 if (!descriptors_.empty())
301 return; 302 return;
302 303
303 Java_ChromeBluetoothRemoteGattCharacteristic_createDescriptors( 304 Java_ChromeBluetoothRemoteGattCharacteristic_createDescriptors(
304 AttachCurrentThread(), j_characteristic_); 305 AttachCurrentThread(), j_characteristic_);
305 } 306 }
306 307
307 } // namespace device 308 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_device_win.cc ('k') | device/bluetooth/bluetooth_remote_gatt_service_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698