| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chromeos/dbus/bluetooth_media_endpoint_service_provider.h" | 5 #include "chromeos/dbus/bluetooth_media_endpoint_service_provider.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 void OnExported(const std::string& interface_name, | 106 void OnExported(const std::string& interface_name, |
| 107 const std::string& method_name, | 107 const std::string& method_name, |
| 108 bool success) { | 108 bool success) { |
| 109 LOG_IF(ERROR, !success) << "Failed to export " << interface_name << "." | 109 LOG_IF(ERROR, !success) << "Failed to export " << interface_name << "." |
| 110 << method_name; | 110 << method_name; |
| 111 } | 111 } |
| 112 | 112 |
| 113 // Called by dbus:: when the remote device connects to the Media Endpoint. | 113 // Called by dbus:: when the remote device connects to the Media Endpoint. |
| 114 void SetConfiguration(dbus::MethodCall* method_call, | 114 void SetConfiguration(dbus::MethodCall* method_call, |
| 115 dbus::ExportedObject::ResponseSender response_sender) { | 115 dbus::ExportedObject::ResponseSender response_sender) { |
| 116 VLOG(1) << "SetConfiuration"; | 116 VLOG(1) << "SetConfiguration"; |
| 117 | 117 |
| 118 DCHECK(OnOriginThread()); | 118 DCHECK(OnOriginThread()); |
| 119 DCHECK(delegate_); | 119 DCHECK(delegate_); |
| 120 | 120 |
| 121 dbus::MessageReader reader(method_call); | 121 dbus::MessageReader reader(method_call); |
| 122 dbus::ObjectPath transport_path; | 122 dbus::ObjectPath transport_path; |
| 123 dbus::MessageReader property_reader(method_call); | 123 dbus::MessageReader property_reader(method_call); |
| 124 if (!reader.PopObjectPath(&transport_path) || | 124 if (!reader.PopObjectPath(&transport_path) || |
| 125 !reader.PopArray(&property_reader)) { | 125 !reader.PopArray(&property_reader)) { |
| 126 LOG(ERROR) << "SetConfiguration called with incorrect parameters: " | 126 LOG(ERROR) << "SetConfiguration called with incorrect parameters: " |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // Returns a real implementation. | 316 // Returns a real implementation. |
| 317 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { | 317 if (!DBusThreadManager::Get()->IsUsingStub(DBusClientBundle::BLUETOOTH)) { |
| 318 return new BluetoothMediaEndpointServiceProviderImpl( | 318 return new BluetoothMediaEndpointServiceProviderImpl( |
| 319 bus, object_path, delegate); | 319 bus, object_path, delegate); |
| 320 } | 320 } |
| 321 // Returns a fake implementation. | 321 // Returns a fake implementation. |
| 322 return new FakeBluetoothMediaEndpointServiceProvider(object_path, delegate); | 322 return new FakeBluetoothMediaEndpointServiceProvider(object_path, delegate); |
| 323 } | 323 } |
| 324 | 324 |
| 325 } // namespace chromeos | 325 } // namespace chromeos |
| OLD | NEW |