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

Unified Diff: dbus/bus.cc

Issue 12022004: D-Bus: ObjectProxy remove function for Bus object. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 11 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 | « dbus/bus.h ('k') | dbus/bus_unittest.cc » ('j') | 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 30b6cc31cfa8f15a888deba5fd993c1175dfc045..51f67b6b1ef2fccadf8a54fa9f9f4a37192da938 100644
--- a/dbus/bus.cc
+++ b/dbus/bus.cc
@@ -235,6 +235,28 @@ ObjectProxy* Bus::GetObjectProxyWithOptions(const std::string& service_name,
return object_proxy.get();
}
+void Bus::RemoveObjectProxy(const std::string& service_name,
+ const ObjectPath& object_path) {
+ RemoveObjectProxyWithOptions(service_name, object_path,
+ ObjectProxy::DEFAULT_OPTIONS);
+}
+
+void Bus::RemoveObjectProxyWithOptions(const std::string& service_name,
+ const dbus::ObjectPath& object_path,
+ int options) {
+ AssertOnOriginThread();
+
+ // Check if we have the requested object proxy.
+ const ObjectProxyTable::key_type key(service_name + object_path.value(),
+ options);
+ ObjectProxyTable::iterator iter = object_proxy_table_.find(key);
+ if (iter != object_proxy_table_.end()) {
+ // Detach and erase
+ iter->second.get()->Detach();
satorux1 2013/01/18 17:32:40 You cannot all Detach() here, as Detach() should b
+ object_proxy_table_.erase(iter);
+ }
+}
+
ExportedObject* Bus::GetExportedObject(const ObjectPath& object_path) {
AssertOnOriginThread();
« no previous file with comments | « dbus/bus.h ('k') | dbus/bus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698