crosswalk-project/crosswalk — pull request #1263 by cmarcelo (2013-12-05 22:14:01+00:00)
Title: [Application][D-Bus] Request service name after object tree is built

The code was wrongly setting up the object tree (and it's interfaces)
only after the name was registered. This caused a race condition when
testing D-Bus auto activation: the client would wait for service name to
get up and try to call it, and in some cases the objects or interfaces
were not ready yet.

The code now will request the service name only after everything is
setup.

As part of this change, DBusManager interface changed a bit: it doesn't
try to handle service ownership anymore and just sticks to setting up
the bus. It also initializes the Bus connection (and the thread) lazily,
so we can move it to a more general Crosswalk object but ensuring that
connection won't be created if not used.