Currently, we have two timing issues around Mojo initialization.
1) In Android container,
The implementation of init() needs asynchronous operation.
So, Chrome cannot know when it is actually established.
2) InstanceHolder can have multiple observers.
There is no guarantee about the order of calls.
This means, as Init() is called in one of OnInstanceReady(), there is a possibility that other OnInstanceReady() can be called before Init().
How to solve;
- add another "init" method with callback. It is called when Android side's container gets actually ready. Along with it, deprecate older one.
- move "calling Init()" part from each service implementation to InstanceHolder.
- OnInstanceReady() will be called after new Init()'s callback is called.
This will conflict with other team members' current effort, so suspend till M63.
Comment 1 by hidehiko@chromium.org
, Jul 31 2017