OLD | NEW |
---|---|
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_adapter_profile_chromeos.h" | 5 #include "device/bluetooth/bluetooth_adapter_profile_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 // static | 21 // static |
22 void BluetoothAdapterProfileChromeOS::Register( | 22 void BluetoothAdapterProfileChromeOS::Register( |
23 const device::BluetoothUUID& uuid, | 23 const device::BluetoothUUID& uuid, |
24 const BluetoothProfileManagerClient::Options& options, | 24 const BluetoothProfileManagerClient::Options& options, |
25 const ProfileRegisteredCallback& success_callback, | 25 const ProfileRegisteredCallback& success_callback, |
26 const BluetoothProfileManagerClient::ErrorCallback& error_callback) { | 26 const BluetoothProfileManagerClient::ErrorCallback& error_callback) { |
27 scoped_ptr<BluetoothAdapterProfileChromeOS> profile( | 27 scoped_ptr<BluetoothAdapterProfileChromeOS> profile( |
28 new BluetoothAdapterProfileChromeOS(uuid)); | 28 new BluetoothAdapterProfileChromeOS(uuid)); |
29 | 29 |
30 VLOG(1) << "Registering profile: " << profile->object_path().value(); | 30 VLOG(1) << "Registering profile: " << profile->object_path().value(); |
31 const dbus::ObjectPath& object_path = profile->object_path(); | |
31 DBusThreadManager::Get()->GetBluetoothProfileManagerClient()->RegisterProfile( | 32 DBusThreadManager::Get()->GetBluetoothProfileManagerClient()->RegisterProfile( |
32 profile->object_path(), | 33 object_path, |
armansito
2015/03/11 06:48:38
I really don't see how this is a NULL pointer dere
Ilya Sherman
2015/03/11 09:23:54
I agree that it's surprising that unit tests didn'
armansito
2015/03/11 16:44:29
OK, I guess that makes sense. I would elaborate a
armansito
2015/03/11 17:09:24
Also, it's not technically a NULL-pointer derefere
| |
33 uuid.canonical_value(), | 34 uuid.canonical_value(), |
34 options, | 35 options, |
35 base::Bind(success_callback, base::Passed(&profile)), | 36 base::Bind(success_callback, base::Passed(&profile)), |
36 error_callback); | 37 error_callback); |
37 } | 38 } |
38 | 39 |
39 BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS( | 40 BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS( |
40 const device::BluetoothUUID& uuid) | 41 const device::BluetoothUUID& uuid) |
41 : uuid_(uuid), weak_ptr_factory_(this) { | 42 : uuid_(uuid), weak_ptr_factory_(this) { |
42 std::string uuid_path; | 43 std::string uuid_path; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 // Cancel() should only go to a delegate accepting connections. | 153 // Cancel() should only go to a delegate accepting connections. |
153 if (delegates_.find("") == delegates_.end()) { | 154 if (delegates_.find("") == delegates_.end()) { |
154 VLOG(1) << object_path_.value() << ": Cancel with no delegate!"; | 155 VLOG(1) << object_path_.value() << ": Cancel with no delegate!"; |
155 return; | 156 return; |
156 } | 157 } |
157 | 158 |
158 delegates_[""]->Cancel(); | 159 delegates_[""]->Cancel(); |
159 } | 160 } |
160 | 161 |
161 } // namespace chromeos | 162 } // namespace chromeos |
OLD | NEW |