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

Unified Diff: device/bluetooth/bluetooth_audio_sink_chromeos.h

Issue 910023002: device/bluetooth:Implement BluetoothMediaEndpointServiceProvider delegate and media-related overrid… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the addition/removal of all types of observer to constructor/destructor. 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_audio_sink_chromeos.h
diff --git a/device/bluetooth/bluetooth_audio_sink_chromeos.h b/device/bluetooth/bluetooth_audio_sink_chromeos.h
index 37994d3019c1b92f1b180c8505b2ae6a124d5f9c..3af285b68732b2f87083c9426214dcc2c46c527c 100644
--- a/device/bluetooth/bluetooth_audio_sink_chromeos.h
+++ b/device/bluetooth/bluetooth_audio_sink_chromeos.h
@@ -23,6 +23,8 @@
namespace chromeos {
+class BluetoothAudioSinkChromeOSTest;
+
class DEVICE_BLUETOOTH_EXPORT BluetoothAudioSinkChromeOS
: public device::BluetoothAudioSink,
public device::BluetoothAdapter::Observer,
@@ -34,6 +36,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAudioSinkChromeOS
scoped_refptr<device::BluetoothAdapter> adapter);
// device::BluetoothAudioSink overrides.
+ // Unregisters a BluetoothAudioSink. |callback| should handle
+ // the clean-up after the audio sink is deleted successfully, otherwise
+ // |error_callback| will be called.
+ void Unregister(
+ const base::Closure& callback,
+ const device::BluetoothAudioSink::ErrorCallback& error_callback) override;
void AddObserver(BluetoothAudioSink::Observer* observer) override;
void RemoveObserver(BluetoothAudioSink::Observer* observer) override;
device::BluetoothAudioSink::State GetState() const override;
@@ -53,12 +61,12 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAudioSinkChromeOS
// BluetoothMediaEndpointServiceProvider::Delegate overrides.
void SetConfiguration(const dbus::ObjectPath& transport_path,
- const dbus::MessageReader& properties) override;
+ const TransportProperties& properties) override;
void SelectConfiguration(
const std::vector<uint8_t>& capabilities,
const SelectConfigurationCallback& callback) override;
void ClearConfiguration(const dbus::ObjectPath& transport_path) override;
- void Release() override;
+ void Released() override;
// Registers a BluetoothAudioSink. User applications can use |options| to
// configure the audio sink. |callback| will be executed if the audio sink is
@@ -69,12 +77,9 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAudioSinkChromeOS
const base::Closure& callback,
const device::BluetoothAudioSink::ErrorCallback& error_callback);
- // Unregisters a BluetoothAudioSink. |callback| should handle
- // the clean-up after the audio sink is deleted successfully, otherwise
- // |error_callback| will be called.
- void Unregister(
- const base::Closure& callback,
- const device::BluetoothAudioSink::ErrorCallback& error_callback) override;
+ // Returns a pointer to the media endpoint object. This function should be
+ // used for testing purpose only.
+ BluetoothMediaEndpointServiceProvider* GetEndpointServiceProvider();
private:
~BluetoothAudioSinkChromeOS() override;
@@ -98,6 +103,13 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothAudioSinkChromeOS
// notify |observer_| while the audio data is available.
void ReadFromFD();
+ // Helper functions to clean up media, media transport and media endpoint.
+ // Called when the |state_| changes to either STATE_INVALID or
+ // STATE_DISCONNECTED.
+ void ResetMedia();
+ void ResetTransport();
+ void ResetEndpoint();
+
// The connection state between the BluetoothAudioSinkChromeOS and the remote
// device.
device::BluetoothAudioSink::State state_;
« no previous file with comments | « chromeos/dbus/fake_bluetooth_media_transport_client.cc ('k') | device/bluetooth/bluetooth_audio_sink_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698