diff options
author | keybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-25 18:20:08 +0000 |
---|---|---|
committer | keybuk@chromium.org <keybuk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-25 18:20:08 +0000 |
commit | 9cc40cb2061532d345a6ec925e97563631132e9e (patch) | |
tree | ecfb2c793420271b3b172f27ecebc66ae966bb65 /dbus/bus.h | |
parent | dbc220a0550880c4d35d75a57f10663d3e1ed240 (diff) | |
download | chromium_src-9cc40cb2061532d345a6ec925e97563631132e9e.zip chromium_src-9cc40cb2061532d345a6ec925e97563631132e9e.tar.gz chromium_src-9cc40cb2061532d345a6ec925e97563631132e9e.tar.bz2 |
Support D-Bus Object Manager
Object Manager is a new standard D-Bus interface, closely related to
the Properties interface. It is used by BlueZ 5.x thus the need to
implement it now.
The intended use is that Chrome D-Bus Client singletons set up a link
to an object manager in their constructor and register themselves to
handle their particular interface.
BUG=220951
TEST=dbus_unittests
Review URL: https://codereview.chromium.org/12491014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/bus.h')
-rw-r--r-- | dbus/bus.h | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -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_; |