We used to have a fairly strict stance from security folk that if a message
doesn't do anything for a given platform, it shouldn't have a handler in the
first place. (Hence the #ifdef OS_WIN)
Have we changed that stance with mojo?
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAKZ7acO1PyQ0c1jB4Oe6WOxcMPSnbvFGRDFFXw8QxZL%2BWbYDKQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NHSram7rzxd5r2GOutApLBHKqVR8ApSp5OhoVc8TAGBCA%40mail.gmail.com.
On Dec 15, 2016 4:18 AM, "Colin Blundell" <blun...@chromium.org> wrote:How would this impact the generation of mojom files for e.g. Java and JS? Personally
This has been and remains my main concern with preprocessing mojom. Running them through the preprocessor is trivial to do, but this can only limit the code we generate, i.e. It can only cull the generated symbol definitions.We have no ability to output corresponding conditionals in Java or JS bindings. We do care about JS bindings being redistributable, and there doesn't seem to be a great way to inform clients about their host platform. We'd have to introduce a native binding API that provided platform information at runtime.
Best,Colin
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAKZ7acO1PyQ0c1jB4Oe6WOxcMPSnbvFGRDFFXw8QxZL%2BWbYDKQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NHSram7rzxd5r2GOutApLBHKqVR8ApSp5OhoVc8TAGBCA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NGQPm5nJCrFO3wCFQOzH1hMQLtDAFF6iR37Hv%2Be8FoUcw%40mail.gmail.com.
Best,Colin
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAKZ7acO1PyQ0c1jB4Oe6WOxcMPSnbvFGRDFFXw8QxZL%2BWbYDKQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NHSram7rzxd5r2GOutApLBHKqVR8ApSp5OhoVc8TAGBCA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NGQPm5nJCrFO3wCFQOzH1hMQLtDAFF6iR37Hv%2Be8FoUcw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CA%2BapAgHwSKmZ5OarxNORaQ%2B%3D_8zJ%2B5chrvUK%3Dye7ao_pqXjbtA%40mail.gmail.com.
We have no ability to output corresponding conditionals in Java or JS bindings. We do care about JS bindings being redistributable, and there doesn't seem to be a great way to inform clients about their host platform. We'd have to introduce a native binding API that provided platform information at runtime.
Best,Colin
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAKZ7acO1PyQ0c1jB4Oe6WOxcMPSnbvFGRDFFXw8QxZL%2BWbYDKQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NHSram7rzxd5r2GOutApLBHKqVR8ApSp5OhoVc8TAGBCA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NGQPm5nJCrFO3wCFQOzH1hMQLtDAFF6iR37Hv%2Be8FoUcw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
In practice, doesn't Java imply Android anyway?
While Mojo tries to be language-agnostic in many respects, at the end of the day, C++ is by far the most common language in the Chromium code base. A struct with Android-specific fields requires non-Android platforms to populate the fields with dummy values, adding noise, or for the fields to be marked as optional, complicating Android validation (if the parameters are required). The individual costs are small, but it does add up.Having#if defined(OS_ANDROID)gfx.mojom.Point point;#endif
Best,Colin
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAKZ7acO1PyQ0c1jB4Oe6WOxcMPSnbvFGRDFFXw8QxZL%2BWbYDKQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NHSram7rzxd5r2GOutApLBHKqVR8ApSp5OhoVc8TAGBCA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NGQPm5nJCrFO3wCFQOzH1hMQLtDAFF6iR37Hv%2Be8FoUcw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CA%2BapAgHwSKmZ5OarxNORaQ%2B%3D_8zJ%2B5chrvUK%3Dye7ao_pqXjbtA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAF3XrKpRc58Udqhw0%3DQUZ_KwmaN_phcJPwS7Y%2B1VvvH70Np_Ng%40mail.gmail.com.
On Fri, Dec 16, 2016 at 10:15 AM Daniel Cheng <dch...@chromium.org> wrote:In practice, doesn't Java imply Android anyway?There are cross-platform interfaces whose most natural implementation is in Java on Android (e.g., battery status). So if what you're implying is that an interface that would be implemented in Java on Android necessarily is tied to Android *as an interface*, I don't think that's true.While Mojo tries to be language-agnostic in many respects, at the end of the day, C++ is by far the most common language in the Chromium code base. A struct with Android-specific fields requires non-Android platforms to populate the fields with dummy values, adding noise, or for the fields to be marked as optional, complicating Android validation (if the parameters are required). The individual costs are small, but it does add up.Having#if defined(OS_ANDROID)gfx.mojom.Point point;#endif
On Fri, Dec 16, 2016 at 10:20 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:15 AM Daniel Cheng <dch...@chromium.org> wrote:In practice, doesn't Java imply Android anyway?There are cross-platform interfaces whose most natural implementation is in Java on Android (e.g., battery status). So if what you're implying is that an interface that would be implemented in Java on Android necessarily is tied to Android *as an interface*, I don't think that's true.While Mojo tries to be language-agnostic in many respects, at the end of the day, C++ is by far the most common language in the Chromium code base. A struct with Android-specific fields requires non-Android platforms to populate the fields with dummy values, adding noise, or for the fields to be marked as optional, complicating Android validation (if the parameters are required). The individual costs are small, but it does add up.Having#if defined(OS_ANDROID)gfx.mojom.Point point;#endifOne further thought: If we did something like this, it would mean that the Android impl of this interface would have to be in C++ and (presumably) go across to Java via JNI. This definitely undercuts part of the vision of Mojo.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAMGE5NGyhSBU9YD0VCtZpnReXJm%2BueVV%3DWZ4dDkBP9-30G%2B0XA%40mail.gmail.com.
On Fri, Dec 16, 2016 at 1:22 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:20 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:15 AM Daniel Cheng <dch...@chromium.org> wrote:In practice, doesn't Java imply Android anyway?There are cross-platform interfaces whose most natural implementation is in Java on Android (e.g., battery status). So if what you're implying is that an interface that would be implemented in Java on Android necessarily is tied to Android *as an interface*, I don't think that's true.While Mojo tries to be language-agnostic in many respects, at the end of the day, C++ is by far the most common language in the Chromium code base. A struct with Android-specific fields requires non-Android platforms to populate the fields with dummy values, adding noise, or for the fields to be marked as optional, complicating Android validation (if the parameters are required). The individual costs are small, but it does add up.Having#if defined(OS_ANDROID)gfx.mojom.Point point;#endifOne further thought: If we did something like this, it would mean that the Android impl of this interface would have to be in C++ and (presumably) go across to Java via JNI. This definitely undercuts part of the vision of Mojo.My point is that this doesn't require conditional compilation of Java. Java implementations would be able to use any defined(OS_ANDROID) things just by virtue of being Java, since Java implies OS_ANDROID.
On Fri, Dec 16, 2016 at 10:27 AM Daniel Cheng <dch...@chromium.org> wrote:On Fri, Dec 16, 2016 at 1:22 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:20 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:15 AM Daniel Cheng <dch...@chromium.org> wrote:In practice, doesn't Java imply Android anyway?There are cross-platform interfaces whose most natural implementation is in Java on Android (e.g., battery status). So if what you're implying is that an interface that would be implemented in Java on Android necessarily is tied to Android *as an interface*, I don't think that's true.While Mojo tries to be language-agnostic in many respects, at the end of the day, C++ is by far the most common language in the Chromium code base. A struct with Android-specific fields requires non-Android platforms to populate the fields with dummy values, adding noise, or for the fields to be marked as optional, complicating Android validation (if the parameters are required). The individual costs are small, but it does add up.Having#if defined(OS_ANDROID)gfx.mojom.Point point;#endifOne further thought: If we did something like this, it would mean that the Android impl of this interface would have to be in C++ and (presumably) go across to Java via JNI. This definitely undercuts part of the vision of Mojo.My point is that this doesn't require conditional compilation of Java. Java implementations would be able to use any defined(OS_ANDROID) things just by virtue of being Java, since Java implies OS_ANDROID.I'm confused. What is your proposed implementation of proprocessing the mojoms? I had thought we were talking about Ken's proposal, wherein we would use the C preprocessor but only allow it if the mojom target was specified to generate only cpp bindings.
On Fri, Dec 16, 2016 at 1:29 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:27 AM Daniel Cheng <dch...@chromium.org> wrote:On Fri, Dec 16, 2016 at 1:22 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:20 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:15 AM Daniel Cheng <dch...@chromium.org> wrote:In practice, doesn't Java imply Android anyway?There are cross-platform interfaces whose most natural implementation is in Java on Android (e.g., battery status). So if what you're implying is that an interface that would be implemented in Java on Android necessarily is tied to Android *as an interface*, I don't think that's true.While Mojo tries to be language-agnostic in many respects, at the end of the day, C++ is by far the most common language in the Chromium code base. A struct with Android-specific fields requires non-Android platforms to populate the fields with dummy values, adding noise, or for the fields to be marked as optional, complicating Android validation (if the parameters are required). The individual costs are small, but it does add up.Having#if defined(OS_ANDROID)gfx.mojom.Point point;#endifOne further thought: If we did something like this, it would mean that the Android impl of this interface would have to be in C++ and (presumably) go across to Java via JNI. This definitely undercuts part of the vision of Mojo.My point is that this doesn't require conditional compilation of Java. Java implementations would be able to use any defined(OS_ANDROID) things just by virtue of being Java, since Java implies OS_ANDROID.I'm confused. What is your proposed implementation of proprocessing the mojoms? I had thought we were talking about Ken's proposal, wherein we would use the C preprocessor but only allow it if the mojom target was specified to generate only cpp bindings.I think we should just unconditionally preprocess them all.
Even if Mojo doesn't expose a hook for this, an alternative is to just define a mojom per-platform and only add it to the build on that platform. It's brittle, it's fragile, and it involves a bunch of copy and paste, but it works. It also affect Java/JS bindings in exactly the same way that conditional compilation would.
On Fri, Dec 16, 2016 at 10:34 AM Daniel Cheng <dch...@chromium.org> wrote:On Fri, Dec 16, 2016 at 1:29 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:27 AM Daniel Cheng <dch...@chromium.org> wrote:On Fri, Dec 16, 2016 at 1:22 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:20 AM Colin Blundell <blun...@chromium.org> wrote:On Fri, Dec 16, 2016 at 10:15 AM Daniel Cheng <dch...@chromium.org> wrote:In practice, doesn't Java imply Android anyway?There are cross-platform interfaces whose most natural implementation is in Java on Android (e.g., battery status). So if what you're implying is that an interface that would be implemented in Java on Android necessarily is tied to Android *as an interface*, I don't think that's true.While Mojo tries to be language-agnostic in many respects, at the end of the day, C++ is by far the most common language in the Chromium code base. A struct with Android-specific fields requires non-Android platforms to populate the fields with dummy values, adding noise, or for the fields to be marked as optional, complicating Android validation (if the parameters are required). The individual costs are small, but it does add up.Having#if defined(OS_ANDROID)gfx.mojom.Point point;#endifOne further thought: If we did something like this, it would mean that the Android impl of this interface would have to be in C++ and (presumably) go across to Java via JNI. This definitely undercuts part of the vision of Mojo.My point is that this doesn't require conditional compilation of Java. Java implementations would be able to use any defined(OS_ANDROID) things just by virtue of being Java, since Java implies OS_ANDROID.I'm confused. What is your proposed implementation of proprocessing the mojoms? I had thought we were talking about Ken's proposal, wherein we would use the C preprocessor but only allow it if the mojom target was specified to generate only cpp bindings.I think we should just unconditionally preprocess them all.But what would we do in generating Java/JS bindings? Just ignore the markup? Sorry, there's something I'm missing here.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAF3XrKoTo_u5DLTzu1U3SAgHyThju5DGHfZOkEqdXdvZ-mQPsg%40mail.gmail.com.
The C++-only suggestion was proposed as a compromise, because the above proposal is untenable if we want portable JS bindings. We do want portable JS bindings.
It's a good point (and fortunate for us) that Java will effectively always mean Android.
An alternative compromise is that we make preprocessing opt-in via an explicit GN option in the mojom template, and that this option also disables JS bindings generation.
What I am not willing to allow is unconditional preprocessing of all mojom files regardless of target language, because that puts is in an undesirable position. I want the choice to use preprocessing to be explicit, and I want to make sure it's clear that choosing to do preprocessing is also choosing to be non-portable.
I would be OK with an opt-in, though I don't agree that it should disable JS binding generation. As I mentioned elsewhere, it's trivial to subvert the goal of universal JS bindings by using GN itself to only conditionally include mojoms on certain platforms.
...
[Message clipped]
I'd prefer this as something the bindings generator understands. That would allow the wire format to be consistent across all platforms while the higher-level APIs could omit fields and methods not supported on particular platforms.
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAJqEsoDVej3D8b5dOPU%2BGqdFG4cXyBSOW8ExVDSjPSsLEt1K7g%40mail.gmail.com.
Personally I still think that this is pretty unfortunate. Part of the reason we're going to all this effort is to develop a cleaner architecture, and while ifdefs are definitely the right way to go in some cases, I feel that they also provide an easy path to hackiness. Mojo already has a natural separation between interface and implementation and natural ways to signal that a particular functionality isn't supported from implementor to client. I hope that the ability to use ifdefs in mojom doesn't receive significant abuse and lead to engineers taking shortcuts in interface design (I'm of course not worried about anyone in this conversation, but rather down the line as the floodgates get opened).The consensus on this thread is clearly in favor of making this change, so I just wanted to put my non-blocking dissent out there to satisfy my own conscience ;).
--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.
To post to this group, send email to chromi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CAKZ7acMLr9kkh07OC0UkSOAPjh44GMDj_1AvYyxeKmg%3DkaEj-A%40mail.gmail.com.
whatever syntax is used for mojom files is the mojom syntax.
The question here is whether to add the C preprocessor to mojom syntax or to add new mojom annotations.
The question here is whether to add the C preprocessor to mojom syntax or to add new mojom annotations.Even if they achieve the same purpose at the moment, the level of commitment is different.
The question here is whether to add the C preprocessor to mojom syntax or to add new mojom annotations.Even if they achieve the same purpose at the moment, the level of commitment is different.How so? Once this feature is used, we're committed to it either way; an arbitrary chrome developer won't see a difference. All this distinction achieves is the illusion of mojoms still being pure and untainted by platform-specific concerns, while at the same time adding platform-specific concerns to mojoms.
The question here is whether to add the C preprocessor to mojom syntax or to add new mojom annotations.Even if they achieve the same purpose at the moment, the level of commitment is different.How so? Once this feature is used, we're committed to it either way; an arbitrary chrome developer won't see a difference. All this distinction achieves is the illusion of mojoms still being pure and untainted by platform-specific concerns, while at the same time adding platform-specific concerns to mojoms.The distinction in my mind is whether we regard the ability to use C preprocessor syntax as part of the definition of the mojom language that we would export beyond Chromium. I'm arguing that we shouldn't (and thus, mojom files that use the C preprocessor would be by definition internal to Chromium).
The question here is whether to add the C preprocessor to mojom syntax or to add new mojom annotations.Even if they achieve the same purpose at the moment, the level of commitment is different.How so? Once this feature is used, we're committed to it either way; an arbitrary chrome developer won't see a difference. All this distinction achieves is the illusion of mojoms still being pure and untainted by platform-specific concerns, while at the same time adding platform-specific concerns to mojoms.The distinction in my mind is whether we regard the ability to use C preprocessor syntax as part of the definition of the mojom language that we would export beyond Chromium. I'm arguing that we shouldn't (and thus, mojom files that use the C preprocessor would be by definition internal to Chromium).Are we planning to export mojom beyond Chromium?
If we do, how do you intend to convince external users to not use the C preprocessor in the same way?