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

Issue 242763003: Implement a trivial Mojo EchoService that can be connected to over DBus (Closed)

Created:
6 years, 8 months ago by Chris Masone
Modified:
6 years, 7 months ago
CC:
chromium-reviews, Aaron Boodman, darin (slow to review), viettrungluu+watch_chromium.org, ben+mojo_chromium.org, abarth-chromium
Visibility:
Public.

Description

Implement a trivial Mojo EchoService that can be connected to over DBus Some systems might like to use Mojo IPC to talk to services that are running outside the auspices of the Mojo shell. DBus is one potential channel to use for bootstrapping such a connection. In order to allow the externally-running service to accept connections from a Mojo shell, we need to get it a ShellHandle. This change defines a DBusServiceLoader that implements the ServiceLoader interface. DBusServiceLoader creates a dedicated MessagePipe, passes a handle to one end to the desired service over DBus, and then passes the ShellHandle over that pipe. This class assumes the following: 1) Your service is already running, 2) Your service implements the Mojo ExternalService API (from external_service.mojom). 3) Your service exports an object that implements the org.chromium.Mojo DBus interface: <interface name="org.chromium.Mojo"> <method name="ConnectChannel"> <arg type="h" name="file_descriptor" direction="in" /> </method> </interface> This change also includes a trivial DBusEchoService that can be "loaded" using the DBusServiceLoader, as well as a mojo example app that connects to this service. BUG=364903 TEST=run mojo_dbus_echo_service in one shell, and then load mojo_dbus_echo in the mojo shell. "who" should successfully echo between the two. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=265927 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266508

Patch Set 1 #

Patch Set 2 : Dropped logging in dbus_echo_service to VLOG #

Total comments: 3

Patch Set 3 : Build DBus-related stuff only on Linux #

Patch Set 4 : Rebase onto ServiceConnection/Connector CL #

Patch Set 5 : Rebase onto dave's CL to move ServiceLoader ownership #

Total comments: 8

Patch Set 6 : Automatically exclude DBusServiceLoader on non-Linux #

Total comments: 12

Patch Set 7 : Fix Nits #

Patch Set 8 : rebase #

Patch Set 9 : Fix clang breakage #

Patch Set 10 : Rebase to switch MojoChannelInit to ChannelInit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+633 lines, -6 lines) Patch
A mojo/examples/dbus_echo/dbus_echo_app.cc View 1 2 3 4 5 6 7 8 1 chunk +67 lines, -0 lines 0 comments Download
M mojo/mojo.gyp View 1 2 3 4 5 6 7 8 9 4 chunks +28 lines, -0 lines 0 comments Download
M mojo/mojo_examples.gypi View 1 2 3 4 5 6 7 1 chunk +20 lines, -0 lines 0 comments Download
M mojo/mojo_services.gypi View 1 2 3 4 5 6 7 8 9 2 chunks +39 lines, -0 lines 0 comments Download
A + mojo/services/dbus_echo/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
A mojo/services/dbus_echo/dbus_echo_service.cc View 1 2 3 4 5 6 7 8 9 1 chunk +167 lines, -0 lines 0 comments Download
A + mojo/services/dbus_echo/echo.mojom View 3 4 5 6 7 1 chunk +8 lines, -6 lines 0 comments Download
M mojo/shell/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M mojo/shell/context.cc View 1 2 3 4 5 6 3 chunks +11 lines, -0 lines 0 comments Download
A mojo/shell/dbus_service_loader_linux.h View 1 2 3 4 5 6 1 chunk +90 lines, -0 lines 0 comments Download
A mojo/shell/dbus_service_loader_linux.cc View 1 2 3 4 5 6 7 8 9 1 chunk +185 lines, -0 lines 0 comments Download
A mojo/shell/external_service.mojom View 1 chunk +16 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (0 generated)
Chris Masone
I still need to make all the dbus-using stuff conditionally compile only on Linux, but ...
6 years, 8 months ago (2014-04-18 18:26:27 UTC) #1
viettrungluu
I haven't looked at it super-closely yet (which I should do), but what I've seen ...
6 years, 8 months ago (2014-04-18 19:40:15 UTC) #2
Chris Masone
On 2014/04/18 19:40:15, viettrungluu wrote: > I haven't looked at it super-closely yet (which I ...
6 years, 8 months ago (2014-04-22 03:20:54 UTC) #3
DaveMoore
https://codereview.chromium.org/242763003/diff/50001/mojo/mojo.gyp File mojo/mojo.gyp (right): https://codereview.chromium.org/242763003/diff/50001/mojo/mojo.gyp#newcode487 mojo/mojo.gyp:487: 'shell/dbus_service_loader.cc', It's more common in gyp files to list ...
6 years, 8 months ago (2014-04-22 20:39:51 UTC) #4
Chris Masone
https://codereview.chromium.org/242763003/diff/50001/mojo/mojo.gyp File mojo/mojo.gyp (right): https://codereview.chromium.org/242763003/diff/50001/mojo/mojo.gyp#newcode487 mojo/mojo.gyp:487: 'shell/dbus_service_loader.cc', On 2014/04/22 20:39:51, DaveMoore wrote: > It's more ...
6 years, 8 months ago (2014-04-22 21:16:29 UTC) #5
viettrungluu
On 2014/04/22 21:16:29, Chris Masone wrote: > https://codereview.chromium.org/242763003/diff/50001/mojo/mojo.gyp > File mojo/mojo.gyp (right): > > https://codereview.chromium.org/242763003/diff/50001/mojo/mojo.gyp#newcode487 ...
6 years, 8 months ago (2014-04-23 16:44:41 UTC) #6
Chris Masone
On 2014/04/23 16:44:41, viettrungluu wrote: > On 2014/04/22 21:16:29, Chris Masone wrote: > > https://codereview.chromium.org/242763003/diff/50001/mojo/mojo.gyp ...
6 years, 8 months ago (2014-04-23 19:41:36 UTC) #7
viettrungluu
LGTM w/nits. https://codereview.chromium.org/242763003/diff/70001/mojo/services/dbus_echo/dbus_echo_service.cc File mojo/services/dbus_echo/dbus_echo_service.cc (right): https://codereview.chromium.org/242763003/diff/70001/mojo/services/dbus_echo/dbus_echo_service.cc#newcode1 mojo/services/dbus_echo/dbus_echo_service.cc:1: // Copyright (c) 2014 The Chromium Authors. ...
6 years, 8 months ago (2014-04-23 20:07:24 UTC) #8
Chris Masone
https://codereview.chromium.org/242763003/diff/70001/mojo/services/dbus_echo/dbus_echo_service.cc File mojo/services/dbus_echo/dbus_echo_service.cc (right): https://codereview.chromium.org/242763003/diff/70001/mojo/services/dbus_echo/dbus_echo_service.cc#newcode1 mojo/services/dbus_echo/dbus_echo_service.cc:1: // Copyright (c) 2014 The Chromium Authors. All rights ...
6 years, 8 months ago (2014-04-23 22:30:59 UTC) #9
Chris Masone
The CQ bit was checked by cmasone@chromium.org
6 years, 8 months ago (2014-04-24 00:13:54 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmasone@chromium.org/242763003/110001
6 years, 8 months ago (2014-04-24 00:14:39 UTC) #11
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 00:23:20 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on chromium_presubmit
6 years, 8 months ago (2014-04-24 00:23:21 UTC) #13
Chris Masone
On 2014/04/24 00:23:21, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 8 months ago (2014-04-24 00:39:03 UTC) #14
keybuk
lgtm
6 years, 8 months ago (2014-04-24 11:43:48 UTC) #15
Chris Masone
The CQ bit was checked by cmasone@chromium.org
6 years, 8 months ago (2014-04-24 13:06:49 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmasone@chromium.org/242763003/110001
6 years, 8 months ago (2014-04-24 13:30:35 UTC) #17
commit-bot: I haz the power
Change committed as 265927
6 years, 8 months ago (2014-04-24 16:17:59 UTC) #18
Chris Masone
The CQ bit was checked by cmasone@chromium.org
6 years, 8 months ago (2014-04-24 18:44:52 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmasone@chromium.org/242763003/130001
6 years, 8 months ago (2014-04-24 21:10:05 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 22:58:56 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 8 months ago (2014-04-24 22:58:56 UTC) #22
Chris Masone
The CQ bit was checked by cmasone@chromium.org
6 years, 8 months ago (2014-04-25 16:34:06 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmasone@chromium.org/242763003/130001
6 years, 8 months ago (2014-04-25 17:54:57 UTC) #24
Chris Masone
The CQ bit was unchecked by cmasone@chromium.org
6 years, 8 months ago (2014-04-25 23:34:24 UTC) #25
Chris Masone
The CQ bit was checked by cmasone@chromium.org
6 years, 7 months ago (2014-04-27 22:01:06 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmasone@chromium.org/242763003/150001
6 years, 7 months ago (2014-04-27 22:02:19 UTC) #27
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-28 03:52:36 UTC) #28
commit-bot: I haz the power
The commit queue went berserk retrying too often for a seemingly flaky test on builder ...
6 years, 7 months ago (2014-04-28 03:52:37 UTC) #29
Chris Masone
The CQ bit was checked by cmasone@chromium.org
6 years, 7 months ago (2014-04-28 03:57:05 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmasone@chromium.org/242763003/150001
6 years, 7 months ago (2014-04-28 03:58:13 UTC) #31
commit-bot: I haz the power
6 years, 7 months ago (2014-04-28 11:53:18 UTC) #32
Message was sent while issue was closed.
Change committed as 266508

Powered by Google App Engine
This is Rietveld 408576698