| Index: chromeos/dbus/shill_client_helper.cc
|
| diff --git a/chromeos/dbus/flimflam_client_helper.cc b/chromeos/dbus/shill_client_helper.cc
|
| similarity index 79%
|
| rename from chromeos/dbus/flimflam_client_helper.cc
|
| rename to chromeos/dbus/shill_client_helper.cc
|
| index 3696496d65f675994f9e8e0b680a7cacfd17e0a2..bd421bcfa453f26f02bd5b809d0dc0f2038d275a 100644
|
| --- a/chromeos/dbus/flimflam_client_helper.cc
|
| +++ b/chromeos/dbus/shill_client_helper.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chromeos/dbus/flimflam_client_helper.h"
|
| +#include "chromeos/dbus/shill_client_helper.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/values.h"
|
| @@ -13,95 +13,95 @@
|
|
|
| namespace chromeos {
|
|
|
| -FlimflamClientHelper::FlimflamClientHelper(dbus::Bus* bus,
|
| +ShillClientHelper::ShillClientHelper(dbus::Bus* bus,
|
| dbus::ObjectProxy* proxy)
|
| : blocking_method_caller_(bus, proxy),
|
| proxy_(proxy),
|
| weak_ptr_factory_(this) {
|
| }
|
|
|
| -FlimflamClientHelper::~FlimflamClientHelper() {
|
| +ShillClientHelper::~ShillClientHelper() {
|
| }
|
|
|
| -void FlimflamClientHelper::SetPropertyChangedHandler(
|
| +void ShillClientHelper::SetPropertyChangedHandler(
|
| const PropertyChangedHandler& handler) {
|
| property_changed_handler_ = handler;
|
| }
|
|
|
| -void FlimflamClientHelper::ResetPropertyChangedHandler() {
|
| +void ShillClientHelper::ResetPropertyChangedHandler() {
|
| property_changed_handler_.Reset();
|
| }
|
|
|
| -void FlimflamClientHelper::MonitorPropertyChanged(
|
| +void ShillClientHelper::MonitorPropertyChanged(
|
| const std::string& interface_name) {
|
| // We are not using dbus::PropertySet to monitor PropertyChanged signal
|
| // because the interface is not "org.freedesktop.DBus.Properties".
|
| proxy_->ConnectToSignal(interface_name,
|
| flimflam::kMonitorPropertyChanged,
|
| - base::Bind(&FlimflamClientHelper::OnPropertyChanged,
|
| + base::Bind(&ShillClientHelper::OnPropertyChanged,
|
| weak_ptr_factory_.GetWeakPtr()),
|
| - base::Bind(&FlimflamClientHelper::OnSignalConnected,
|
| + base::Bind(&ShillClientHelper::OnSignalConnected,
|
| weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| -void FlimflamClientHelper::CallVoidMethod(
|
| +void ShillClientHelper::CallVoidMethod(
|
| dbus::MethodCall* method_call,
|
| const VoidDBusMethodCallback& callback) {
|
| proxy_->CallMethod(method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| - base::Bind(&FlimflamClientHelper::OnVoidMethod,
|
| + base::Bind(&ShillClientHelper::OnVoidMethod,
|
| weak_ptr_factory_.GetWeakPtr(),
|
| callback));
|
| }
|
|
|
| -void FlimflamClientHelper::CallObjectPathMethod(
|
| +void ShillClientHelper::CallObjectPathMethod(
|
| dbus::MethodCall* method_call,
|
| const ObjectPathDBusMethodCallback& callback) {
|
| proxy_->CallMethod(method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| - base::Bind(&FlimflamClientHelper::OnObjectPathMethod,
|
| + base::Bind(&ShillClientHelper::OnObjectPathMethod,
|
| weak_ptr_factory_.GetWeakPtr(),
|
| callback));
|
| }
|
|
|
| -void FlimflamClientHelper::CallDictionaryValueMethod(
|
| +void ShillClientHelper::CallDictionaryValueMethod(
|
| dbus::MethodCall* method_call,
|
| const DictionaryValueCallback& callback) {
|
| proxy_->CallMethod(method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| - base::Bind(&FlimflamClientHelper::OnDictionaryValueMethod,
|
| + base::Bind(&ShillClientHelper::OnDictionaryValueMethod,
|
| weak_ptr_factory_.GetWeakPtr(),
|
| callback));
|
| }
|
|
|
| -void FlimflamClientHelper::CallVoidMethodWithErrorCallback(
|
| +void ShillClientHelper::CallVoidMethodWithErrorCallback(
|
| dbus::MethodCall* method_call,
|
| const base::Closure& callback,
|
| const ErrorCallback& error_callback) {
|
| proxy_->CallMethodWithErrorCallback(
|
| method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| - base::Bind(&FlimflamClientHelper::OnVoidMethodWithErrorCallback,
|
| + base::Bind(&ShillClientHelper::OnVoidMethodWithErrorCallback,
|
| weak_ptr_factory_.GetWeakPtr(),
|
| callback),
|
| - base::Bind(&FlimflamClientHelper::OnError,
|
| + base::Bind(&ShillClientHelper::OnError,
|
| weak_ptr_factory_.GetWeakPtr(),
|
| error_callback));
|
| }
|
|
|
| -void FlimflamClientHelper::CallDictionaryValueMethodWithErrorCallback(
|
| +void ShillClientHelper::CallDictionaryValueMethodWithErrorCallback(
|
| dbus::MethodCall* method_call,
|
| const DictionaryValueCallbackWithoutStatus& callback,
|
| const ErrorCallback& error_callback) {
|
| proxy_->CallMethodWithErrorCallback(
|
| method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
|
| base::Bind(
|
| - &FlimflamClientHelper::OnDictionaryValueMethodWithErrorCallback,
|
| + &ShillClientHelper::OnDictionaryValueMethodWithErrorCallback,
|
| weak_ptr_factory_.GetWeakPtr(),
|
| callback,
|
| error_callback),
|
| - base::Bind(&FlimflamClientHelper::OnError,
|
| + base::Bind(&ShillClientHelper::OnError,
|
| weak_ptr_factory_.GetWeakPtr(),
|
| error_callback));
|
| }
|
|
|
| -bool FlimflamClientHelper::CallVoidMethodAndBlock(
|
| +bool ShillClientHelper::CallVoidMethodAndBlock(
|
| dbus::MethodCall* method_call) {
|
| scoped_ptr<dbus::Response> response(
|
| blocking_method_caller_.CallMethodAndBlock(method_call));
|
| @@ -110,7 +110,7 @@ bool FlimflamClientHelper::CallVoidMethodAndBlock(
|
| return true;
|
| }
|
|
|
| -dbus::ObjectPath FlimflamClientHelper::CallObjectPathMethodAndBlock(
|
| +dbus::ObjectPath ShillClientHelper::CallObjectPathMethodAndBlock(
|
| dbus::MethodCall* method_call) {
|
| scoped_ptr<dbus::Response> response(
|
| blocking_method_caller_.CallMethodAndBlock(method_call));
|
| @@ -125,7 +125,7 @@ dbus::ObjectPath FlimflamClientHelper::CallObjectPathMethodAndBlock(
|
| return result;
|
| }
|
|
|
| -base::DictionaryValue* FlimflamClientHelper::CallDictionaryValueMethodAndBlock(
|
| +base::DictionaryValue* ShillClientHelper::CallDictionaryValueMethodAndBlock(
|
| dbus::MethodCall* method_call) {
|
| scoped_ptr<dbus::Response> response(
|
| blocking_method_caller_.CallMethodAndBlock(method_call));
|
| @@ -143,7 +143,7 @@ base::DictionaryValue* FlimflamClientHelper::CallDictionaryValueMethodAndBlock(
|
| }
|
|
|
| // static
|
| -void FlimflamClientHelper::AppendValueDataAsVariant(dbus::MessageWriter* writer,
|
| +void ShillClientHelper::AppendValueDataAsVariant(dbus::MessageWriter* writer,
|
| const base::Value& value) {
|
| // Support basic types and string-to-string dictionary.
|
| switch (value.GetType()) {
|
| @@ -184,14 +184,14 @@ void FlimflamClientHelper::AppendValueDataAsVariant(dbus::MessageWriter* writer,
|
|
|
| }
|
|
|
| -void FlimflamClientHelper::OnSignalConnected(const std::string& interface,
|
| +void ShillClientHelper::OnSignalConnected(const std::string& interface,
|
| const std::string& signal,
|
| bool success) {
|
| LOG_IF(ERROR, !success) << "Connect to " << interface << " " << signal
|
| << " failed.";
|
| }
|
|
|
| -void FlimflamClientHelper::OnPropertyChanged(dbus::Signal* signal) {
|
| +void ShillClientHelper::OnPropertyChanged(dbus::Signal* signal) {
|
| if (property_changed_handler_.is_null())
|
| return;
|
|
|
| @@ -205,7 +205,7 @@ void FlimflamClientHelper::OnPropertyChanged(dbus::Signal* signal) {
|
| property_changed_handler_.Run(name, *value);
|
| }
|
|
|
| -void FlimflamClientHelper::OnVoidMethod(const VoidDBusMethodCallback& callback,
|
| +void ShillClientHelper::OnVoidMethod(const VoidDBusMethodCallback& callback,
|
| dbus::Response* response) {
|
| if (!response) {
|
| callback.Run(DBUS_METHOD_CALL_FAILURE);
|
| @@ -214,7 +214,7 @@ void FlimflamClientHelper::OnVoidMethod(const VoidDBusMethodCallback& callback,
|
| callback.Run(DBUS_METHOD_CALL_SUCCESS);
|
| }
|
|
|
| -void FlimflamClientHelper::OnObjectPathMethod(
|
| +void ShillClientHelper::OnObjectPathMethod(
|
| const ObjectPathDBusMethodCallback& callback,
|
| dbus::Response* response) {
|
| if (!response) {
|
| @@ -230,7 +230,7 @@ void FlimflamClientHelper::OnObjectPathMethod(
|
| callback.Run(DBUS_METHOD_CALL_SUCCESS, result);
|
| }
|
|
|
| -void FlimflamClientHelper::OnDictionaryValueMethod(
|
| +void ShillClientHelper::OnDictionaryValueMethod(
|
| const DictionaryValueCallback& callback,
|
| dbus::Response* response) {
|
| if (!response) {
|
| @@ -249,13 +249,13 @@ void FlimflamClientHelper::OnDictionaryValueMethod(
|
| callback.Run(DBUS_METHOD_CALL_SUCCESS, *result);
|
| }
|
|
|
| -void FlimflamClientHelper::OnVoidMethodWithErrorCallback(
|
| +void ShillClientHelper::OnVoidMethodWithErrorCallback(
|
| const base::Closure& callback,
|
| dbus::Response* response) {
|
| callback.Run();
|
| }
|
|
|
| -void FlimflamClientHelper::OnDictionaryValueMethodWithErrorCallback(
|
| +void ShillClientHelper::OnDictionaryValueMethodWithErrorCallback(
|
| const DictionaryValueCallbackWithoutStatus& callback,
|
| const ErrorCallback& error_callback,
|
| dbus::Response* response) {
|
| @@ -271,7 +271,7 @@ void FlimflamClientHelper::OnDictionaryValueMethodWithErrorCallback(
|
| callback.Run(*result);
|
| }
|
|
|
| -void FlimflamClientHelper::OnError(const ErrorCallback& error_callback,
|
| +void ShillClientHelper::OnError(const ErrorCallback& error_callback,
|
| dbus::ErrorResponse* response) {
|
| std::string error_name;
|
| std::string error_message;
|
|
|