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

Unified Diff: dbus/bus.h

Issue 12491014: Support D-Bus Object Manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Insufficient entrails in my offering Created 7 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 | « chromeos/dbus/dbus_thread_manager.cc ('k') | dbus/bus.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/bus.h
diff --git a/dbus/bus.h b/dbus/bus.h
index 1641699e5243f446b4faace722d355815767b060..ec6bef1ea417edfb0f4d80875875f8eb98720ecb 100644
--- a/dbus/bus.h
+++ b/dbus/bus.h
@@ -32,6 +32,7 @@ class Location;
namespace dbus {
class ExportedObject;
+class ObjectManager;
class ObjectProxy;
// Bus is used to establish a connection with D-Bus, create object
@@ -302,6 +303,37 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// Must be called in the origin thread.
virtual void UnregisterExportedObject(const ObjectPath& object_path);
+
+ // Gets an object manager for the given remote object path |object_path|
+ // exported by the service |service_name|.
+ //
+ // Returns an existing object manager if the bus object already owns a
+ // matching object manager, never returns NULL.
+ //
+ // The caller must not delete the returned object, the bus retains ownership
+ // of all object managers.
+ //
+ // Must be called in the origin thread.
+ virtual ObjectManager* GetObjectManager(const std::string& service_name,
+ const ObjectPath& object_path);
+
+ // Unregisters the object manager for the given remote object path
+ // |object_path| exported by the srevice |service_name|.
+ //
+ // Getting an object manager for the same remote object after this call
+ // will return a new object, method calls on any remaining copies of the
+ // previous object are not permitted.
+ //
+ // Must be called in the origin thread.
+ virtual void RemoveObjectManager(const std::string& service_name,
+ const ObjectPath& object_path);
+
+ // Instructs all registered object managers to retrieve their set of managed
+ // objects from their respective remote objects. There is no need to call this
+ // manually, this is called automatically by the D-Bus thread manager once
+ // implementation classes are registered.
+ virtual void GetManagedObjects();
+
// Shuts down the bus and blocks until it's done. More specifically, this
// function does the following:
//
@@ -608,6 +640,13 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
scoped_refptr<dbus::ExportedObject> > ExportedObjectTable;
ExportedObjectTable exported_object_table_;
+ // ObjectManagerTable is used to hold the object managers created by the
+ // bus object. Key is a concatenated string of service name + object path,
+ // like "org.chromium.TestService/org/chromium/TestObject".
+ typedef std::map<std::string,
+ scoped_refptr<dbus::ObjectManager> > ObjectManagerTable;
+ ObjectManagerTable object_manager_table_;
+
bool async_operations_set_up_;
bool shutdown_completed_;
« no previous file with comments | « chromeos/dbus/dbus_thread_manager.cc ('k') | dbus/bus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698