| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_socket_chromeos.h" | 5 #include "device/bluetooth/bluetooth_socket_chromeos.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 // Create the service provider for the profile object. | 239 // Create the service provider for the profile object. |
| 240 dbus::Bus* system_bus = DBusThreadManager::Get()->GetSystemBus(); | 240 dbus::Bus* system_bus = DBusThreadManager::Get()->GetSystemBus(); |
| 241 profile_.reset(BluetoothProfileServiceProvider::Create( | 241 profile_.reset(BluetoothProfileServiceProvider::Create( |
| 242 system_bus, object_path_, this)); | 242 system_bus, object_path_, this)); |
| 243 DCHECK(profile_.get()); | 243 DCHECK(profile_.get()); |
| 244 | 244 |
| 245 // Before reaching out to the Bluetooth Daemon to register a listening socket, | 245 // Before reaching out to the Bluetooth Daemon to register a listening socket, |
| 246 // make sure it's actually running. If not, report success and carry on; | 246 // make sure it's actually running. If not, report success and carry on; |
| 247 // the profile will be registered when the daemon becomes available. | 247 // the profile will be registered when the daemon becomes available. |
| 248 if (adapter_ && !adapter_->IsPresent()) { | 248 if (adapter_.get() && !adapter_->IsPresent()) { |
| 249 VLOG(1) << object_path_.value() << ": Delaying profile registration."; | 249 VLOG(1) << object_path_.value() << ": Delaying profile registration."; |
| 250 success_callback.Run(); | 250 success_callback.Run(); |
| 251 return; | 251 return; |
| 252 } | 252 } |
| 253 | 253 |
| 254 VLOG(1) << object_path_.value() << ": Registering profile."; | 254 VLOG(1) << object_path_.value() << ": Registering profile."; |
| 255 DBusThreadManager::Get()->GetBluetoothProfileManagerClient()-> | 255 DBusThreadManager::Get()->GetBluetoothProfileManagerClient()-> |
| 256 RegisterProfile( | 256 RegisterProfile( |
| 257 object_path_, | 257 object_path_, |
| 258 uuid_.canonical_value(), | 258 uuid_.canonical_value(), |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 // It's okay if the profile doesn't exist, it means we haven't registered it | 584 // It's okay if the profile doesn't exist, it means we haven't registered it |
| 585 // yet. | 585 // yet. |
| 586 if (error_name == bluetooth_profile_manager::kErrorDoesNotExist) | 586 if (error_name == bluetooth_profile_manager::kErrorDoesNotExist) |
| 587 return; | 587 return; |
| 588 | 588 |
| 589 LOG(WARNING) << object_path_.value() << ": Failed to unregister profile: " | 589 LOG(WARNING) << object_path_.value() << ": Failed to unregister profile: " |
| 590 << error_name << ": " << error_message; | 590 << error_name << ": " << error_message; |
| 591 } | 591 } |
| 592 | 592 |
| 593 } // namespace chromeos | 593 } // namespace chromeos |
| OLD | NEW |