Chromium Code Reviews| 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 | 79 |
| 80 // BluetoothAdapter: | 80 // BluetoothAdapter: |
| 81 void Shutdown() override; | 81 void Shutdown() override; |
| 82 std::string GetAddress() const override; | 82 std::string GetAddress() const override; |
| 83 std::string GetName() const override; | 83 std::string GetName() const override; |
| 84 void SetName(const std::string& name, | 84 void SetName(const std::string& name, |
| 85 const base::Closure& callback, | 85 const base::Closure& callback, |
| 86 const ErrorCallback& error_callback) override; | 86 const ErrorCallback& error_callback) override; |
| 87 bool IsInitialized() const override; | 87 bool IsInitialized() const override; |
| 88 bool IsPresent() const override; | 88 bool IsPresent() const override; |
| 89 void SetDisabled(bool disabled) override; | |
| 89 bool IsPowered() const override; | 90 bool IsPowered() const override; |
| 90 void SetPowered(bool powered, | 91 void SetPowered(bool powered, |
| 91 const base::Closure& callback, | 92 const base::Closure& callback, |
| 92 const ErrorCallback& error_callback) override; | 93 const ErrorCallback& error_callback) override; |
| 93 bool IsDiscoverable() const override; | 94 bool IsDiscoverable() const override; |
| 94 void SetDiscoverable(bool discoverable, | 95 void SetDiscoverable(bool discoverable, |
| 95 const base::Closure& callback, | 96 const base::Closure& callback, |
| 96 const ErrorCallback& error_callback) override; | 97 const ErrorCallback& error_callback) override; |
| 97 bool IsDiscovering() const override; | 98 bool IsDiscovering() const override; |
| 98 void CreateRfcommService( | 99 void CreateRfcommService( |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 // ended (with either success or failure). | 340 // ended (with either success or failure). |
| 340 void ProcessQueuedDiscoveryRequests(); | 341 void ProcessQueuedDiscoveryRequests(); |
| 341 | 342 |
| 342 InitCallback init_callback_; | 343 InitCallback init_callback_; |
| 343 | 344 |
| 344 bool initialized_; | 345 bool initialized_; |
| 345 | 346 |
| 346 // Set in |Shutdown()|, makes IsPresent()| return false. | 347 // Set in |Shutdown()|, makes IsPresent()| return false. |
| 347 bool dbus_is_shutdown_; | 348 bool dbus_is_shutdown_; |
| 348 | 349 |
| 350 // Set in |SetDisabled()|, makes |IsPresent()| return false | |
| 351 // (just disables the interface, doesn't actually shut it down). | |
|
Andrew T Wilson (Slow)
2016/04/13 13:55:11
One question - why did we decide to change the val
Ivan Šandrk
2016/04/13 17:19:04
It seemed like a simpler solution since no code ch
| |
| 352 bool is_disabled_; | |
| 353 | |
| 349 // Number of discovery sessions that have been added. | 354 // Number of discovery sessions that have been added. |
| 350 int num_discovery_sessions_; | 355 int num_discovery_sessions_; |
| 351 | 356 |
| 352 // True, if there is a pending request to start or stop discovery. | 357 // True, if there is a pending request to start or stop discovery. |
| 353 bool discovery_request_pending_; | 358 bool discovery_request_pending_; |
| 354 | 359 |
| 355 // List of queued requests to add new discovery sessions. While there is a | 360 // List of queued requests to add new discovery sessions. While there is a |
| 356 // pending request to BlueZ to start or stop discovery, many requests from | 361 // pending request to BlueZ to start or stop discovery, many requests from |
| 357 // within Chrome to start or stop discovery sessions may occur. We only | 362 // within Chrome to start or stop discovery sessions may occur. We only |
| 358 // queue requests to add new sessions to be processed later. All requests to | 363 // queue requests to add new sessions to be processed later. All requests to |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 386 // Note: This should remain the last member so it'll be destroyed and | 391 // Note: This should remain the last member so it'll be destroyed and |
| 387 // invalidate its weak pointers before any other members are destroyed. | 392 // invalidate its weak pointers before any other members are destroyed. |
| 388 base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_; | 393 base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_; |
| 389 | 394 |
| 390 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ); | 395 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ); |
| 391 }; | 396 }; |
| 392 | 397 |
| 393 } // namespace bluez | 398 } // namespace bluez |
| 394 | 399 |
| 395 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ | 400 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ |
| OLD | NEW |