diff options
author | mcchou <mcchou@chromium.org> | 2015-02-27 20:48:42 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-28 04:49:18 +0000 |
commit | e5b0eb64fa46348c4c329cd20dd5727ed593810f (patch) | |
tree | 7e59745d0d9f805051831482948eba27d1335d20 /chromeos/dbus | |
parent | cdf6fe7b23444014b70b5fa97d7cb5222d64a20a (diff) | |
download | chromium_src-e5b0eb64fa46348c4c329cd20dd5727ed593810f.zip chromium_src-e5b0eb64fa46348c4c329cd20dd5727ed593810f.tar.gz chromium_src-e5b0eb64fa46348c4c329cd20dd5727ed593810f.tar.bz2 |
chromeos/dbus: Add verbose log to media-related clients and service provider.
This CL adds some VLOG to BluetoothMediaClient,
BluetoothMediaTransportClient, BluetoothMediaEndpointServiceProvider
and BluetoothAudioSinkChromeOS.
BUG=429016
TEST=None
Review URL: https://codereview.chromium.org/963983002
Cr-Commit-Position: refs/heads/master@{#318598}
Diffstat (limited to 'chromeos/dbus')
-rw-r--r-- | chromeos/dbus/bluetooth_media_client.cc | 4 | ||||
-rw-r--r-- | chromeos/dbus/bluetooth_media_endpoint_service_provider.cc | 36 | ||||
-rw-r--r-- | chromeos/dbus/bluetooth_media_transport_client.cc | 6 |
3 files changed, 33 insertions, 13 deletions
diff --git a/chromeos/dbus/bluetooth_media_client.cc b/chromeos/dbus/bluetooth_media_client.cc index 23fc2ed..0bdca3f 100644 --- a/chromeos/dbus/bluetooth_media_client.cc +++ b/chromeos/dbus/bluetooth_media_client.cc @@ -103,6 +103,8 @@ class BluetoothMediaClientImpl const EndpointProperties& properties, const base::Closure& callback, const ErrorCallback& error_callback) override { + VLOG(1) << "RegisterEndpoint - endpoint: " << endpoint_path.value(); + dbus::MethodCall method_call(kBluetoothMediaInterface, kRegisterEndpoint); dbus::MessageWriter writer(&method_call); @@ -155,6 +157,8 @@ class BluetoothMediaClientImpl const dbus::ObjectPath& endpoint_path, const base::Closure& callback, const ErrorCallback& error_callback) override { + VLOG(1) << "UnregisterEndpoint - endpoint: " << endpoint_path.value(); + dbus::MethodCall method_call(kBluetoothMediaInterface, kUnregisterEndpoint); // Send the path to the endpoint. diff --git a/chromeos/dbus/bluetooth_media_endpoint_service_provider.cc b/chromeos/dbus/bluetooth_media_endpoint_service_provider.cc index 82b9742..49e9bad 100644 --- a/chromeos/dbus/bluetooth_media_endpoint_service_provider.cc +++ b/chromeos/dbus/bluetooth_media_endpoint_service_provider.cc @@ -106,13 +106,15 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl void OnExported(const std::string& interface_name, const std::string& method_name, bool success) { - LOG_IF(WARNING, !success) << "Failed to export " - << interface_name << "." << method_name; + LOG_IF(ERROR, !success) << "Failed to export " << interface_name << "." + << method_name; } // Called by dbus:: when the remote device connects to the Media Endpoint. void SetConfiguration(dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender) { + VLOG(1) << "SetConfiuration"; + DCHECK(OnOriginThread()); DCHECK(delegate_); @@ -121,8 +123,8 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl dbus::MessageReader property_reader(method_call); if (!reader.PopObjectPath(&transport_path) || !reader.PopArray(&property_reader)) { - LOG(WARNING) << "SetConfiguration called with incorrect parameters: " - << method_call->ToString(); + LOG(ERROR) << "SetConfiguration called with incorrect parameters: " + << method_call->ToString(); return; } @@ -134,8 +136,8 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl std::string key; if (!property_reader.PopDictEntry(&dict_entry_reader) || !dict_entry_reader.PopString(&key)) { - LOG(WARNING) << "SetConfiguration called with incorrect parameters: " - << method_call->ToString(); + LOG(ERROR) << "SetConfiguration called with incorrect parameters: " + << method_call->ToString(); } else if (key == BluetoothMediaTransportClient::kDeviceProperty) { dict_entry_reader.PopVariantOfObjectPath(&properties.device); } else if (key == BluetoothMediaTransportClient::kUUIDProperty) { @@ -164,8 +166,8 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl properties.state != kInvalidState) { delegate_->SetConfiguration(transport_path, properties); } else { - LOG(WARNING) << "SetConfiguration called with incorrect parameters: " - << method_call->ToString(); + LOG(ERROR) << "SetConfiguration called with incorrect parameters: " + << method_call->ToString(); } response_sender.Run(dbus::Response::FromMethodCall(method_call)); @@ -176,6 +178,8 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl void SelectConfiguration( dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender) { + VLOG(1) << "SelectConfiguration"; + DCHECK(OnOriginThread()); DCHECK(delegate_); @@ -183,8 +187,8 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl const uint8_t* capabilities = nullptr; size_t length = 0; if (!reader.PopArrayOfBytes(&capabilities, &length)) { - LOG(WARNING) << "SelectConfiguration called with incorrect parameters: " - << method_call->ToString(); + LOG(ERROR) << "SelectConfiguration called with incorrect parameters: " + << method_call->ToString(); return; } @@ -205,14 +209,16 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl void ClearConfiguration( dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender) { + VLOG(1) << "ClearConfiguration"; + DCHECK(OnOriginThread()); DCHECK(delegate_); dbus::MessageReader reader(method_call); dbus::ObjectPath transport_path; if (!reader.PopObjectPath(&transport_path)) { - LOG(WARNING) << "ClearConfiguration called with incorrect parameters: " - << method_call->ToString(); + LOG(ERROR) << "ClearConfiguration called with incorrect parameters: " + << method_call->ToString(); return; } @@ -225,6 +231,8 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl // Endpoint. void Release(dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender) { + VLOG(1) << "Release"; + DCHECK(OnOriginThread()); DCHECK(delegate_); @@ -238,6 +246,8 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl void OnConfiguration(dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender, const std::vector<uint8_t>& configuration) { + VLOG(1) << "OnConfiguration"; + DCHECK(OnOriginThread()); // Generates the response to the method call. @@ -245,7 +255,7 @@ class CHROMEOS_EXPORT BluetoothMediaEndpointServiceProviderImpl dbus::Response::FromMethodCall(method_call)); dbus::MessageWriter writer(response.get()); if (configuration.empty()) { - LOG(WARNING) << "OnConfiguration called with empty configuration."; + LOG(ERROR) << "OnConfiguration called with empty configuration."; writer.AppendArrayOfBytes(nullptr, 0); } else { writer.AppendArrayOfBytes(&configuration[0], configuration.size()); diff --git a/chromeos/dbus/bluetooth_media_transport_client.cc b/chromeos/dbus/bluetooth_media_transport_client.cc index 7672ea3..2be8a56 100644 --- a/chromeos/dbus/bluetooth_media_transport_client.cc +++ b/chromeos/dbus/bluetooth_media_transport_client.cc @@ -129,6 +129,8 @@ class BluetoothMediaTransportClientImpl void Acquire(const dbus::ObjectPath& object_path, const AcquireCallback& callback, const ErrorCallback& error_callback) override { + VLOG(1) << "Acquire - transport: " << object_path.value(); + DCHECK(object_manager_); dbus::MethodCall method_call(kBluetoothMediaTransportInterface, kAcquire); @@ -150,6 +152,8 @@ class BluetoothMediaTransportClientImpl void TryAcquire(const dbus::ObjectPath& object_path, const AcquireCallback& callback, const ErrorCallback& error_callback) override { + VLOG(1) << "TryAcquire - transport: " << object_path.value(); + DCHECK(object_manager_); dbus::MethodCall method_call(kBluetoothMediaTransportInterface, @@ -172,6 +176,8 @@ class BluetoothMediaTransportClientImpl void Release(const dbus::ObjectPath& object_path, const base::Closure& callback, const ErrorCallback& error_callback) override { + VLOG(1) << "Release - transport: " << object_path.value(); + DCHECK(object_manager_); dbus::MethodCall method_call(kBluetoothMediaTransportInterface, kRelease); |