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

Unified Diff: device/bluetooth/bluetooth_device_chromeos.h

Issue 12310048: Bluetooth: Add a "connectable" property to the BluetoothDevice. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_device_chromeos.h
diff --git a/device/bluetooth/bluetooth_device_chromeos.h b/device/bluetooth/bluetooth_device_chromeos.h
index 650207892671252dde2bc8b5e0833d2bd6b39b86..a10c58463429cc3380c50d607337c2be862e298e 100644
--- a/device/bluetooth/bluetooth_device_chromeos.h
+++ b/device/bluetooth/bluetooth_device_chromeos.h
@@ -115,6 +115,12 @@ class BluetoothDeviceChromeOS
const std::string& error_name,
const std::string& error_message);
+ // Update the internal service records cache. On success, |callback| is called
+ // with the updated list. In other case, the internal cache remains intact and
+ // |error_callback| is called.
+ void UpdateServiceRecords(const ServiceRecordsCallback& callback,
+ const ErrorCallback& error_callback);
+
// Called by BluetoothAdapterClient when a call to DiscoverServices()
// completes. |callback| and |error_callback| are the callbacks provided to
// GetServiceRecords.
@@ -130,9 +136,14 @@ class BluetoothDeviceChromeOS
// succeeded, |callback| and |error_callback| are the callbacks provided to
// Connect().
void OnSetTrusted(const base::Closure& callback,
- const ErrorCallback& error_callback,
+ const ConnectErrorCallback& error_callback,
bool success);
+ // Called by UpdateServiceRecords on success, after a CreateDevice or
+ // CreatePaired device success.
+ void OnServicesUpdatedAfterPair(const base::Closure& callback,
+ const ServiceRecordList& list);
+
// Connect application-level protocols of the device to the system, called
// on a successful connection or to reconnect to a device that is already
// paired or previously connected. |error_callback| is called on failure.
@@ -368,6 +379,13 @@ class BluetoothDeviceChromeOS
// Used to keep track of pending application connection requests.
int connecting_applications_counter_;
+ // A service records cache.
+ ServiceRecordList service_records_;
+
+ // This says wether the |service_records_| cache is initialized. Note that an
+ // empty |service_records_| list can be a valid list.
+ bool service_records_loaded_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<BluetoothDeviceChromeOS> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698