Hello Elliott,
I am in the process of removing extra layers from NFC module and rewriting patches that are not yet landed / reviewed.
I've checked status of battery [1] and geolocation [2] refactoring and it looks like there is no consensus about how mojo services would be used.
Can I use mojo services directly from modules (WebKit/Source/modules) or I need to keep proxies in platform layer?
Direct dependency to mojo can eliminate need for dispatchers and conversion between mojo and platform proxy classes.
At the moment nfc codepath looks like:
navigator.nfc.push(NFCMessage)
convert to platform::NFCMessage
nfcDispatcher->push(platform::NFCMessage)
convert platform::NFCMessage to mojo::NFCMessagePtr
mojoNFCServiceProxy->push(mojo::NFCMessagePtr)
Can be:
navigator.nfc.push(NFCMessage)
convert NFCMessage to mojo::NFCMessagePtr
mojoNFCServiceProxy->push(mojo::NFCMessagePtr)
According to Onion Soup [3] document, only platform can depend on mojo.
Is there a technical / architectural limitation that prohibits dependency from blink modules to mojo services?
[1] https://codereview.chromium.org/1538803002
[2] https://codereview.chromium.org/1367853002
[3] https://docs.google.com/document/d/13XsbaBz7A2H0PZIdFcytHf5-fVOlAfkLlIUKhxKzs44/edit#heading=h.tu76yuktjdtq
Best regards,
Alex
I don't want to allow this until Mojo can generate data types that are compatible with WTF. Right now anything that uses mojo::String is causing string copies, the more you use it, the worse things are. Same with vectors or anything else.
Yuzhu is currently working on better array and string types from mojom. Our intent (IIRC) is to generate std::vector and std::string for Chromium, and WebVector and WebString for Blink.
On Fri, Feb 5, 2016 at 9:16 AM, Elliott Sprehn <esp...@chromium.org> wrote:I don't want to allow this until Mojo can generate data types that are compatible with WTF. Right now anything that uses mojo::String is causing string copies, the more you use it, the worse things are. Same with vectors or anything else.When platform/ calls Mojo, we'll anyway need to implement the conversion from WTF types to Mojo types, won't it? (i.e., how helpful is it to restrict Mojo usage only to platform/ from the perspective of efficient type conversions?)
On Fri, Feb 5, 2016 at 9:31 AM, Elliott Sprehn <esp...@chromium.org> wrote:On Thu, Feb 4, 2016 at 4:22 PM, Kentaro Hara <har...@chromium.org> wrote:On Fri, Feb 5, 2016 at 9:16 AM, Elliott Sprehn <esp...@chromium.org> wrote:I don't want to allow this until Mojo can generate data types that are compatible with WTF. Right now anything that uses mojo::String is causing string copies, the more you use it, the worse things are. Same with vectors or anything else.When platform/ calls Mojo, we'll anyway need to implement the conversion from WTF types to Mojo types, won't it? (i.e., how helpful is it to restrict Mojo usage only to platform/ from the perspective of efficient type conversions?)You're less likely to write a bunch of eager conversion code, or loops that do conversions, etc. You end up writing one way conversions WTF -> Mojo, instead of converting back and forth.Hmm. I understand your point.
Aren't these copies already present with the current Blink API? The danger is already present with WebVector and WebString, no?
If you create extra abstractions in platform/ now, then isn't that just technical debt to be removed later?
I agree we should generate Blink friendly bindings. Maybe there is a rational way to do this in parallel?
-Darin
You need an interface that converts from WTF types used in blink, to mojo types used in the IPC (and the other way). If that interface is in platform or core shouldn't mean more code.
Forcing it to be in platform forces you to keep the conversion layer at the boundaries.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALhVsw03%3D50-ej7RDoAuDF1HPwx_H64MX6OAEohawA8xrUn%2BPw%40mail.gmail.com.
Makes sense.
Maybe a some things worth considering as well:
1- Perhaps it would be ideal to not have a monolithic platform library at all? Mojo is designed to enable this. Wouldn't it be better to have all client-side code for battery in one place and then all service-side code in another? Avoiding libraries like platform/ that are the union of many (most) features is a good thing, right?
2- It is not a lot of work to make WTF friendly mojo bindings, so seems best to plan for what you would do if you had that, and then treat the interim as temporary.
-Darin