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

Side by Side Diff: device/bluetooth/bluetooth_adapter_chromeos.h

Issue 935383003: Fix BluetoothAdapterProfileChromeOS lifecycle management (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: further fix ownership, address comments Created 5 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 unified diff | Download patch
OLDNEW
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_CHROMEOS_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // successfully registered, |success_callback| will be called with a pointer 131 // successfully registered, |success_callback| will be called with a pointer
132 // to the profile which is managed by BluetoothAdapterChromeOS. On failure, 132 // to the profile which is managed by BluetoothAdapterChromeOS. On failure,
133 // |error_callback| will be called. 133 // |error_callback| will be called.
134 void UseProfile(const device::BluetoothUUID& uuid, 134 void UseProfile(const device::BluetoothUUID& uuid,
135 const dbus::ObjectPath& device_path, 135 const dbus::ObjectPath& device_path,
136 const BluetoothProfileManagerClient::Options& options, 136 const BluetoothProfileManagerClient::Options& options,
137 BluetoothProfileServiceProvider::Delegate* delegate, 137 BluetoothProfileServiceProvider::Delegate* delegate,
138 const ProfileRegisteredCallback& success_callback, 138 const ProfileRegisteredCallback& success_callback,
139 const ErrorCompletionCallback& error_callback); 139 const ErrorCompletionCallback& error_callback);
140 140
141 // Releases the profile associated with |uuid| 141 // Release use of a profile by a device
Ilya Sherman 2015/02/21 01:22:10 nit: Please end the sentence with a period.
Marie Janssen 2015/02/23 17:49:09 Done.
142 void ReleaseProfile(const device::BluetoothUUID& uuid); 142 void ReleaseProfile(const dbus::ObjectPath& device_path,
143 BluetoothAdapterProfileChromeOS* profile);
143 144
144 protected: 145 protected:
145 // BluetoothAdapter: 146 // BluetoothAdapter:
146 void RemovePairingDelegateInternal( 147 void RemovePairingDelegateInternal(
147 device::BluetoothDevice::PairingDelegate* pairing_delegate) override; 148 device::BluetoothDevice::PairingDelegate* pairing_delegate) override;
148 149
149 private: 150 private:
150 friend class base::DeleteHelper<BluetoothAdapterChromeOS>; 151 friend class base::DeleteHelper<BluetoothAdapterChromeOS>;
151 friend class BluetoothChromeOSTest; 152 friend class BluetoothChromeOSTest;
152 153
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 bool SetProfileDelegate(const device::BluetoothUUID& uuid, 277 bool SetProfileDelegate(const device::BluetoothUUID& uuid,
277 const dbus::ObjectPath& device_path, 278 const dbus::ObjectPath& device_path,
278 BluetoothProfileServiceProvider::Delegate* delegate, 279 BluetoothProfileServiceProvider::Delegate* delegate,
279 const ProfileRegisteredCallback& success_callback, 280 const ProfileRegisteredCallback& success_callback,
280 const ErrorCompletionCallback& error_callback); 281 const ErrorCompletionCallback& error_callback);
281 void OnRegisterProfileError(const device::BluetoothUUID& uuid, 282 void OnRegisterProfileError(const device::BluetoothUUID& uuid,
282 const ErrorCompletionCallback& error_callback, 283 const ErrorCompletionCallback& error_callback,
283 const std::string& error_name, 284 const std::string& error_name,
284 const std::string& error_message); 285 const std::string& error_message);
285 286
287 // Called by BluetoothAdapterProfileChromeOS when there no users of a profile
Ilya Sherman 2015/02/21 01:22:10 nit: s/there//
Marie Janssen 2015/02/23 17:49:09 Done.
288 // remain.
289 void RemoveProfile(const device::BluetoothUUID& uuid);
290
286 // Processes the queued discovery requests. For each DiscoveryCallbackPair in 291 // Processes the queued discovery requests. For each DiscoveryCallbackPair in
287 // the queue, this method will try to add a new discovery session. This method 292 // the queue, this method will try to add a new discovery session. This method
288 // is called whenever a pending D-Bus call to start or stop discovery has 293 // is called whenever a pending D-Bus call to start or stop discovery has
289 // ended (with either success or failure). 294 // ended (with either success or failure).
290 void ProcessQueuedDiscoveryRequests(); 295 void ProcessQueuedDiscoveryRequests();
291 296
292 // Set in |Shutdown()|, makes IsPresent()| return false. 297 // Set in |Shutdown()|, makes IsPresent()| return false.
293 bool dbus_is_shutdown_; 298 bool dbus_is_shutdown_;
294 299
295 // Number of discovery sessions that have been added. 300 // Number of discovery sessions that have been added.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 // Note: This should remain the last member so it'll be destroyed and 334 // Note: This should remain the last member so it'll be destroyed and
330 // invalidate its weak pointers before any other members are destroyed. 335 // invalidate its weak pointers before any other members are destroyed.
331 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_; 336 base::WeakPtrFactory<BluetoothAdapterChromeOS> weak_ptr_factory_;
332 337
333 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS); 338 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterChromeOS);
334 }; 339 };
335 340
336 } // namespace chromeos 341 } // namespace chromeos
337 342
338 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_ 343 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_CHROMEOS_H_
OLDNEW
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_adapter_chromeos.cc » ('j') | device/bluetooth/bluetooth_adapter_chromeos.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698