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

Unified Diff: chrome/browser/chromeos/dbus/bluetooth_manager_client.cc

Issue 9378039: dbus: add ObjectPath type (Closed) Base URL: http://git.chromium.org/git/chromium/src@master
Patch Set: added inequality operator Created 8 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: chrome/browser/chromeos/dbus/bluetooth_manager_client.cc
diff --git a/chrome/browser/chromeos/dbus/bluetooth_manager_client.cc b/chrome/browser/chromeos/dbus/bluetooth_manager_client.cc
index 12f1e8a39dd603dc5b8cabe0a067967d6f92c4c4..8167e6ad67b586c17cb96d05db1cdcd2b59729ab 100644
--- a/chrome/browser/chromeos/dbus/bluetooth_manager_client.cc
+++ b/chrome/browser/chromeos/dbus/bluetooth_manager_client.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/chromeos/system/runtime_environment.h"
#include "dbus/bus.h"
#include "dbus/message.h"
+#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -91,7 +92,7 @@ class BluetoothManagerClientImpl : public BluetoothManagerClient {
void AdapterAddedReceived(dbus::Signal* signal) {
DCHECK(signal);
dbus::MessageReader reader(signal);
- std::string object_path;
+ dbus::ObjectPath object_path;
if (!reader.PopObjectPath(&object_path)) {
LOG(ERROR) << "AdapterAdded signal has incorrect parameters: "
<< signal->ToString();
@@ -112,7 +113,7 @@ class BluetoothManagerClientImpl : public BluetoothManagerClient {
void AdapterRemovedReceived(dbus::Signal* signal) {
DCHECK(signal);
dbus::MessageReader reader(signal);
- std::string object_path;
+ dbus::ObjectPath object_path;
if (!reader.PopObjectPath(&object_path)) {
LOG(ERROR) << "AdapterRemoved signal has incorrect parameters: "
<< signal->ToString();
@@ -133,14 +134,14 @@ class BluetoothManagerClientImpl : public BluetoothManagerClient {
void DefaultAdapterChangedReceived(dbus::Signal* signal) {
DCHECK(signal);
dbus::MessageReader reader(signal);
- std::string adapter;
- if (!reader.PopObjectPath(&adapter)) {
+ dbus::ObjectPath object_path;
+ if (!reader.PopObjectPath(&object_path)) {
LOG(ERROR) << "DefaultAdapterChanged signal has incorrect parameters: "
<< signal->ToString();
return;
}
- VLOG(1) << "Default adapter changed: " << adapter;
- FOR_EACH_OBSERVER(Observer, observers_, DefaultAdapterChanged(adapter));
+ VLOG(1) << "Default adapter changed: " << object_path;
+ FOR_EACH_OBSERVER(Observer, observers_, DefaultAdapterChanged(object_path));
}
// Called by dbus:: when the DefaultAdapterChanged signal is initially
@@ -157,7 +158,7 @@ class BluetoothManagerClientImpl : public BluetoothManagerClient {
dbus::Response* response) {
// Parse response.
bool success = false;
- std::string adapter;
+ dbus::ObjectPath adapter;
if (response != NULL) {
dbus::MessageReader reader(response);
if (!reader.PopObjectPath(&adapter)) {

Powered by Google App Engine
This is Rietveld 408576698