New issue
Advanced search Search tips

Issue 612970 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Mojo bindings: need a way to break circular dependency of mojoms

Project Member Reported by yzshen@chromium.org, May 18 2016

Issue description

Currently we don't allow two mojoms to import each other. We don't support forward declaration of types either.

That is annoying in some cases. The following is one example:

https://code.google.com/p/chromium/codesearch#chromium/src/services/shell/public/interfaces/connector.mojom&l=74

This file defines the following struct:
struct ClientProcessConnection {
  // Provides the shell the ability to bind a ShellClient from the client
  // process to the instance it creates.
  handle<message_pipe> shell_client;

  // Allows the client process launcher to tell the shell the PID of the process
  // it created (the pid isn't supplied directly here as the process may not
  // have been launched by the time Connect() is called.)
  handle<message_pipe> pid_receiver_request;
};

It uses raw handle<message_pipe> in order to avoid importing the mojom files containing those interfaces because that would result in circular dependencies.

We need to either:
(1) allow circular imports in mojoms, but generate code that still compiles (no circular #include, etc.)
(2) introduce syntax for forward declaration
 
Components: -Internals>Mojo Internals>Mojo>Bindings

Comment 2 by yzshen@chromium.org, Jan 18 2017

Cc: blundell@chromium.org
Cc: -roc...@chromium.org rockot@google.com
 Issue 904137  has been merged into this issue.
Cc: -yzshen@chromium.org -tibell@chromium.org
Status: Available (was: Untriaged)
Definitely still valid, and I was disappointed by this again recently. Leaving at P2 as one of the nicer-to-have feature requests in the backlog.

Sign in to add a comment