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

Unified Diff: chrome/browser/chromeos/dbus/bluetooth_device_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_device_client.cc
diff --git a/chrome/browser/chromeos/dbus/bluetooth_device_client.cc b/chrome/browser/chromeos/dbus/bluetooth_device_client.cc
index 606968147dcddff602dc7ec58dfb4d08e17cefff..543d657c1715791d5bc0e88a5a10453e3a0db6b3 100644
--- a/chrome/browser/chromeos/dbus/bluetooth_device_client.cc
+++ b/chrome/browser/chromeos/dbus/bluetooth_device_client.cc
@@ -13,6 +13,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"
@@ -53,14 +54,14 @@ class BluetoothDeviceClientImpl: public BluetoothDeviceClient,
private:
// BluetoothAdapterClient::Observer override.
- virtual void DeviceCreated(const std::string& adapter_path,
- const std::string& object_path) OVERRIDE {
+ virtual void DeviceCreated(const dbus::ObjectPath& adapter_path,
+ const dbus::ObjectPath& object_path) OVERRIDE {
VLOG(1) << "DeviceCreated: " << object_path;
}
// BluetoothAdapterClient::Observer override.
- virtual void DeviceRemoved(const std::string& adapter_path,
- const std::string& object_path) OVERRIDE {
+ virtual void DeviceRemoved(const dbus::ObjectPath& adapter_path,
+ const dbus::ObjectPath& object_path) OVERRIDE {
VLOG(1) << "DeviceRemoved: " << object_path;
RemoveObjectProxyForPath(object_path);
}
@@ -68,7 +69,8 @@ class BluetoothDeviceClientImpl: public BluetoothDeviceClient,
// Ensures that we have a dbus object proxy for a device with dbus
// object path |object_path|, and if not, creates it stores it in
// our |proxy_map_| map.
- dbus::ObjectProxy* GetObjectProxyForPath(const std::string& object_path) {
+ dbus::ObjectProxy* GetObjectProxyForPath(
+ const dbus::ObjectPath& object_path) {
VLOG(1) << "GetObjectProxyForPath: " << object_path;
ProxyMap::iterator it = proxy_map_.find(object_path);
@@ -86,7 +88,7 @@ class BluetoothDeviceClientImpl: public BluetoothDeviceClient,
// Removes the dbus object proxy for the device with dbus object path
// |object_path| from our |proxy_map_| map.
- void RemoveObjectProxyForPath(const std::string& object_path) {
+ void RemoveObjectProxyForPath(const dbus::ObjectPath& object_path) {
VLOG(1) << "RemoveObjectProxyForPath: " << object_path;
proxy_map_.erase(object_path);
}
@@ -98,7 +100,7 @@ class BluetoothDeviceClientImpl: public BluetoothDeviceClient,
dbus::Bus* bus_;
// We maintain a collection of dbus object proxies, one for each device.
- typedef std::map<const std::string, dbus::ObjectProxy*> ProxyMap;
+ typedef std::map<const dbus::ObjectPath, dbus::ObjectProxy*> ProxyMap;
ProxyMap proxy_map_;
// List of observers interested in event notifications from us.

Powered by Google App Engine
This is Rietveld 408576698