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

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

Issue 9668018: dbus: remove service name from ExportedObject (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pay more attention when fixing mock Created 8 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/dbus/cros_dbus_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/dbus/cros_dbus_service.cc
diff --git a/chrome/browser/chromeos/dbus/cros_dbus_service.cc b/chrome/browser/chromeos/dbus/cros_dbus_service.cc
index 5f912ed2ff2814da086a44c12a0b4cac3c2d82d6..8552aca9b081d16b9509965a1ed13e575b4edb5e 100644
--- a/chrome/browser/chromeos/dbus/cros_dbus_service.cc
+++ b/chrome/browser/chromeos/dbus/cros_dbus_service.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/dbus/cros_dbus_service.h"
+#include "base/bind.h"
#include "base/stl_util.h"
#include "base/threading/platform_thread.h"
#include "chrome/browser/chromeos/dbus/proxy_resolution_service_provider.h"
@@ -39,8 +40,11 @@ class CrosDBusServiceImpl : public CrosDBusService {
if (service_started_)
return;
+ bus_->RequestOwnership(kLibCrosServiceName,
+ base::Bind(&CrosDBusServiceImpl::OnOwnership,
+ base::Unretained(this)));
+
exported_object_ = bus_->GetExportedObject(
- kLibCrosServiceName,
dbus::ObjectPath(kLibCrosServicePath));
for (size_t i = 0; i < service_providers_.size(); ++i)
@@ -63,6 +67,12 @@ class CrosDBusServiceImpl : public CrosDBusService {
return base::PlatformThread::CurrentId() == origin_thread_id_;
}
+ // Called when an ownership request is completed.
+ void OnOwnership(const std::string& service_name,
+ bool success) {
+ LOG_IF(ERROR, !success) << "Failed to own: " << service_name;
+ }
+
bool service_started_;
base::PlatformThreadId origin_thread_id_;
dbus::Bus* bus_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/dbus/cros_dbus_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698