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

Unified Diff: dbus/bus.cc

Issue 9691025: dbus: allow unregistering of exported objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« dbus/bus.h ('K') | « dbus/bus.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/bus.cc
diff --git a/dbus/bus.cc b/dbus/bus.cc
index 9d4a43638495a361f54d466e5890424285e2b4e6..71e3dc8733582199a9908939a784832981c565a9 100644
--- a/dbus/bus.cc
+++ b/dbus/bus.cc
@@ -250,6 +250,26 @@ ExportedObject* Bus::GetExportedObject(const ObjectPath& object_path) {
return exported_object.get();
}
+void Bus::UnregisterExportedObject(const ObjectPath& object_path) {
+ AssertOnOriginThread();
+
+ PostTaskToDBusThread(FROM_HERE, base::Bind(
+ &Bus::UnregisterExportedObjectInternal,
+ this, object_path));
+}
+
+void Bus::UnregisterExportedObjectInternal(const ObjectPath& object_path) {
+ AssertOnDBusThread();
+
+ // Make sure the requested object exists.
+ ExportedObjectTable::iterator iter = exported_object_table_.find(object_path);
+ if (iter == exported_object_table_.end())
+ return;
+
+ iter->second->Unregister();
+ exported_object_table_.erase(iter);
+}
+
bool Bus::Connect() {
// dbus_bus_get_private() and dbus_bus_get() are blocking calls.
AssertOnDBusThread();
« dbus/bus.h ('K') | « dbus/bus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698