--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGE5NFGKp5f_RDXH8Atz0WXHLUQUTJmd4yJF%3Dota%2B2wVQ4o-g%40mail.gmail.com.
Here's one thing I was wondering about. I didn't see an answer in the docs you mentioned, but if there is, feel free to point me to it :)AFAIU, two mojo services can either live in the same process or in different processes. If they live in different processes (and don't run on chrome's IO threads), are their IPCs to each other still proxied through the IO threads? If so, would they not be proxied through the IO threads if they lived in the same process?
Thanks!EricOn Mon, May 22, 2017 at 12:41 PM Colin Blundell <blun...@chromium.org> wrote:--TL;DR Ask any questions you have about Mojo/services on this thread and help us determine how to improve the docs, benefiting everyone!Hi all,As the long-term projects of Mojo-ification and servicification ripple out through the codebase and community, the team has heard feedback that documentation is not always as complete as it could be. We've tried hard to fill in gaps (e.g., Mojo, services, servicification strategies), but of course from our perspective it's not always apparent just where the gaps are :). This is your chance to help open our eyes! Ask any questions that you have about either of these, and we'll both make sure that the questions get answered and that the answers make their way into the documentation!Thanks,Colin (on behalf of the services team)PS If you don't have any questions now but think of some later, services-dev@ is always open!
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGE5NFGKp5f_RDXH8Atz0WXHLUQUTJmd4yJF%3Dota%2B2wVQ4o-g%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHZJZiGEo0Zh%3Dr6%3DVs_AeZyHdAO%2BHbL%2BL1zmXjh7yawHs_icWw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BapAgHgQXQ9TyzvY57nPJwtpCXDFVdQrf7DP4Ct_kh8heU7Lw%40mail.gmail.com.
That's cool! Once intraprocess mojo is "free" does it make sense to implement a mojom when you need cross thread communication as well? In other words, is mojo the thing to use for all async communication in chromium and not just when we are thinking about potential process boundaries? Thanks!
That's cool! Once intraprocess mojo is "free" does it make sense to implement a mojom when you need cross thread communication as well? In other words, is mojo the thing to use for all async communication in chromium and not just when we are thinking about potential process boundaries? Thanks!
On Tue, May 23, 2017 at 2:56 PM Fady Samuel <fsa...@chromium.org> wrote:That's cool! Once intraprocess mojo is "free" does it make sense to implement a mojom when you need cross thread communication as well? In other words, is mojo the thing to use for all async communication in chromium and not just when we are thinking about potential process boundaries? Thanks!I don't think so. Defining things in mojom and then implementing them in C++ comes with conceptual overhead over just defining them in C++; I think there needs to be concrete benefit to justify that overhead. Additionally, binary size would presumably balloon.
One thing Mojo is breaking for me is my CTAGS (i.e. my editor can no longer GoTo Definition for things defined in mojoms). Maybe this is just my scripts that only parse .h/.cc IIRC. Do you know if CTAGS understand .mojom? Similarly syntax highlighting in my editor doesn't work, again I could probably just tell it which syntax to assume for .mojom files. Is there documentation on how to set up one's dev environment in a Mojo friendly way?
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGE5NG0cyxgMUuuiyGjoZ_jYaB9V9yt38xUCvwrw2W2eiLhfA%40mail.gmail.com.
One thing Mojo is breaking for me is my CTAGS (i.e. my editor can no longer GoTo Definition for things defined in mojoms). Maybe this is just my scripts that only parse .h/.cc IIRC. Do you know if CTAGS understand .mojom? Similarly syntax highlighting in my editor doesn't work, again I could probably just tell it which syntax to assume for .mojom files. Is there documentation on how to set up one's dev environment in a Mojo friendly way?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BapAgGj6McJeBXi9e9vTa9LN_D6gU9po7%2Bz2cd-789Ap8EjbQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CANHK6RYV%2Bf0b4YxHcOYjrnL9iePhbScv8-kdCAOi%2BieurBnmYw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAEmk%3DMaej%2BTsppwkRvgegYfuv92Huh53z_VD7WO4yKnJUY6ymg%40mail.gmail.com.
One thing that caused a bit of friction for the mojoification of tracing and memory-infra is that we have some core structs in base (because lot of places in the codebase needs to use tracing and memory-infra), hence we cannot depend on the auto-generated mojo stubs from base, hence we had to use typemaps.It's all good and I understand the dependency rationale, but this ended up with me having to review and maintain some extremely mechanical (and error-prone) code like memory_instrumentation_struct_traits.cc. Here's the question: could we have a tools/generate_struct_traits which takes the base class, takes the mojo file and generates the struct traits file which we then check-in. It would be perfectly find to have to run the tool manually, this at least would remove the burden of reviewing and being careful when editing the code.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGE5NFXFWJSBnRPVQRwnXL5R4yfJjBeTgOof8-%2BJGQGwWdmcA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGE5NFXFWJSBnRPVQRwnXL5R4yfJjBeTgOof8-%2BJGQGwWdmcA%40mail.gmail.com.
On Thu, May 25, 2017 at 7:55 PM Primiano Tucci <prim...@chromium.org> wrote:One thing that caused a bit of friction for the mojoification of tracing and memory-infra is that we have some core structs in base (because lot of places in the codebase needs to use tracing and memory-infra), hence we cannot depend on the auto-generated mojo stubs from base, hence we had to use typemaps.It's all good and I understand the dependency rationale, but this ended up with me having to review and maintain some extremely mechanical (and error-prone) code like memory_instrumentation_struct_traits.cc. Here's the question: could we have a tools/generate_struct_traits which takes the base class, takes the mojo file and generates the struct traits file which we then check-in. It would be perfectly find to have to run the tool manually, this at least would remove the burden of reviewing and being careful when editing the code.+Yuzhu Shen, is this something you've thought about?
File services/preferences/persistent_pref_store_impl.cc:
Patch Set #9, Line 60: CommitPendingWriteCallback
The interface uses base::OnceClosure and I don't see where CommitPendingWri
This is an override of mojom::PersistentPrefStore::CommitPendingWrite(). This method takes a CommitPendingWriteCallback as argument. CommitPendingWriteCallback is defined as "using CommitPendingWriteCallback = base::OnceClosure;" in the header generated from preferences.mojom.
My main issue with Mojo is that it effectively defines a new language... I keep running into code where I'm like "oh, what's this type?", then I dig in the codebase and can't find it only to eventually figure out it's a type implicitly defined by Mojo at compile-time [1]... IDEs and code search do not understand these links and nor do I... I'm sure it's all pretty and nice once you've grokked the whole language but I have not.Also, every time I review a CL that touches Mojo code I'm like "how was one supposed to figure out that this was required?" and then "how am I supposed to know as a reviewer that it is correct?", e.g. https://chromium-review.googlesource.com/c/517988/9/services/preferences/public/interfaces/preferences.mojomIt's normal to be exposed to new APIs as a reviewer (same happens with //base all the time), what's annoying is not being able to code search for said unknown things and find an API with documentation. I did find the Mojo documentation online but perhaps it's missing a section about pure syntax/tokens (e.g. what does "=>" mean in the above change, I couldn't find that in the documentation...)
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJTZ7LLD1ZKizgwNB30F9TwB-nfUkb-xeSnoSQvW6pjEGKZGOA%40mail.gmail.com.
On Mon, Jun 5, 2017 at 11:48 AM, Gabriel Charette <g...@chromium.org> wrote:My main issue with Mojo is that it effectively defines a new language... I keep running into code where I'm like "oh, what's this type?", then I dig in the codebase and can't find it only to eventually figure out it's a type implicitly defined by Mojo at compile-time [1]... IDEs and code search do not understand these links and nor do I... I'm sure it's all pretty and nice once you've grokked the whole language but I have not.Also, every time I review a CL that touches Mojo code I'm like "how was one supposed to figure out that this was required?" and then "how am I supposed to know as a reviewer that it is correct?", e.g. https://chromium-review.googlesource.com/c/517988/9/services/preferences/public/interfaces/preferences.mojomIt's normal to be exposed to new APIs as a reviewer (same happens with //base all the time), what's annoying is not being able to code search for said unknown things and find an API with documentation. I did find the Mojo documentation online but perhaps it's missing a section about pure syntax/tokens (e.g. what does "=>" mean in the above change, I couldn't find that in the documentation...)The syntax of .mojom files is described at https://chromium.googlesource.com/chromium/src/+/master/mojo/public/tools/bindings (specifically "=>" is at https://chromium.googlesource.com/chromium/src/+/master/mojo/public/tools/bindings#Interfaces)(Looking at the CL you listed - woah, "CommitPendingWrite() => ()" seems weird at first. Without checking, I think the difference is that "CommitPendingWrite()" would pass an asynchronous message, and the caller would never know when the message handler is finished. While "CommitPendingWrite() => ()" gets a callback called with the "return value" of the message handler. In this case the return value has arguments so the callback has no parameters, so the only use is that the caller knows when CommitPendingWrite is finished.)I agree that Mojo uses a LOT of typedefs which I find hurt discoverability more than they help readability. Are PersistentPrefStorePtr, PersistentPrefStoreRequest and PersistentPrefStorePtrInfo really clearer than mojo::InterfacePtr<PersistentPrefStore>, mojo::InterfaceRequest<PersistentPrefStore>, and mojo::InterfacePtrInfo<PersistentPrefStore>? It's easy to find interface_ptr_info.h and all its documentation in code search by looking for InterfacePtrInfo, which is the natural thing to do if you're not already familiar with Mojo. To know what PersistentPrefStorePtrInfo means you need to already know about that type mapping.(Also, out of curiosity, why is mojo::Binding<PersistentPrefStore> not typedefined to PersistentPrefStoreBinding like all the others?)
On Mon, Jun 5, 2017 at 11:48 AM, Gabriel Charette <g...@chromium.org> wrote:My main issue with Mojo is that it effectively defines a new language... I keep running into code where I'm like "oh, what's this type?", then I dig in the codebase and can't find it only to eventually figure out it's a type implicitly defined by Mojo at compile-time [1]... IDEs and code search do not understand these links and nor do I... I'm sure it's all pretty and nice once you've grokked the whole language but I have not.Also, every time I review a CL that touches Mojo code I'm like "how was one supposed to figure out that this was required?" and then "how am I supposed to know as a reviewer that it is correct?", e.g. https://chromium-review.googlesource.com/c/517988/9/services/preferences/public/interfaces/preferences.mojomIt's normal to be exposed to new APIs as a reviewer (same happens with //base all the time), what's annoying is not being able to code search for said unknown things and find an API with documentation. I did find the Mojo documentation online but perhaps it's missing a section about pure syntax/tokens (e.g. what does "=>" mean in the above change, I couldn't find that in the documentation...)The syntax of .mojom files is described at https://chromium.googlesource.com/chromium/src/+/master/mojo/public/tools/bindings (specifically "=>" is at https://chromium.googlesource.com/chromium/src/+/master/mojo/public/tools/bindings#Interfaces)(Looking at the CL you listed - woah, "CommitPendingWrite() => ()" seems weird at first. Without checking, I think the difference is that "CommitPendingWrite()" would pass an asynchronous message, and the caller would never know when the message handler is finished. While "CommitPendingWrite() => ()" gets a callback called with the "return value" of the message handler. In this case the return value has arguments so the callback has no parameters, so the only use is that the caller knows when CommitPendingWrite is finished.)
I agree that Mojo uses a LOT of typedefs which I find hurt discoverability more than they help readability. Are PersistentPrefStorePtr, PersistentPrefStoreRequest and PersistentPrefStorePtrInfo really clearer than mojo::InterfacePtr<PersistentPrefStore>, mojo::InterfaceRequest<PersistentPrefStore>, and mojo::InterfacePtrInfo<PersistentPrefStore>? It's easy to find interface_ptr_info.h and all its documentation in code search by looking for InterfacePtrInfo, which is the natural thing to do if you're not already familiar with Mojo. To know what PersistentPrefStorePtrInfo means you need to already know about that type mapping.
That is because usually you don't pass mojo::Binding<> around like the other types, and therefore type it less often than the other types.Some people do like shorter names. (Imagine you need to type mojo::AssociatedInterfacePtrInfo<PersistentPrefStore> over and over. :))But I agree that it may have some extra learning cost.
Oh wow, yeah, that was totally non-obvious to me... also IIUC this awaited response isn't synchronous, so how does it know which method to callback? Another magical binding?
--TL;DR Ask any questions you have about Mojo/services on this thread and help us determine how to improve the docs, benefiting everyone!Hi all,As the long-term projects of Mojo-ification and servicification ripple out through the codebase and community, the team has heard feedback that documentation is not always as complete as it could be. We've tried hard to fill in gaps (e.g., Mojo, services, servicification strategies), but of course from our perspective it's not always apparent just where the gaps are :). This is your chance to help open our eyes! Ask any questions that you have about either of these, and we'll both make sure that the questions get answered and that the answers make their way into the documentation!Thanks,Colin (on behalf of the services team)PS If you don't have any questions now but think of some later, services-dev@ is always open!
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGE5NFGKp5f_RDXH8Atz0WXHLUQUTJmd4yJF%3Dota%2B2wVQ4o-g%40mail.gmail.com.
They first result I found for "PtrInfo" in code search is https://cs.chromium.org/chromium/src/out/Debug/gen/ash/public/interfaces/media.mojom.h?l=66&ct=xref_jump_to_def&gsn=MediaClientAssociatedPtrInfo which gives an error:Can't load 'chromium/src/out/Debug/gen/ash/public/interfaces/media.mojom.h': Could not resolve path src/out/Debug/gen/ash/public/interfaces/media.mojom.h.
My personal preference as far as naming goes:InterfacePtrInfo<Foo> and InterfaceRequest<Foo> don't implement Foo, so I would use them directly. The most important methods of those classes are found in InterfacePtrInfo and InterfaceRequest, and I'm well used to the usage where SomeClass<Foo> is a SomeClass specialized to work with Foo. My eyes don't see that as an eyesore; I'm easily able to pick out the two important pieces of information in that concrete type name.InterfacePtr<Foo> is actually an implementation of the Foo interface, so I WOULD use the typedef FooPtr for it, because it's more important to remember that it is-a Foo. So here the typedef reduces confusion because it stops me from thinking that InterfacePtr is a pointer-to-Foo or something like that.
(I also would have named it something like InterfaceProxy instead of InterfacePtr, since "pointer" is already overloaded in C++, but I'm pretty sure that ship has sailed.)
I don't see the word "executable" anywhere, and see very little "library" words. Maybe it's just not obvious to me, but what does a Mojo-ified product look like in terms of:
- executables - is there still just one (chrome), or one per service?
- libraries - is there one per service? do we link everything dynamically, or are we duplicating a lot of object code?
Or from another perspective, if I want to run services which don't require Chrome, what executable do I run, and what shared libraries does that pull in?
On Mon, May 22, 2017 at 4:42 AM Colin Blundell <blun...@chromium.org> wrote:--TL;DR Ask any questions you have about Mojo/services on this thread and help us determine how to improve the docs, benefiting everyone!Hi all,As the long-term projects of Mojo-ification and servicification ripple out through the codebase and community, the team has heard feedback that documentation is not always as complete as it could be. We've tried hard to fill in gaps (e.g., Mojo, services, servicification strategies), but of course from our perspective it's not always apparent just where the gaps are :). This is your chance to help open our eyes! Ask any questions that you have about either of these, and we'll both make sure that the questions get answered and that the answers make their way into the documentation!Thanks,Colin (on behalf of the services team)PS If you don't have any questions now but think of some later, services-dev@ is always open!
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGE5NFGKp5f_RDXH8Atz0WXHLUQUTJmd4yJF%3Dota%2B2wVQ4o-g%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACi5S_1dr4-G-r%2Ba08WRO1zY_g9j-KvYEAiDnTHqeD6O4Ac5EQ%40mail.gmail.com.
On Mon, Jun 5, 2017 at 2:12 PM, Joe Mason <joenot...@chromium.org> wrote:They first result I found for "PtrInfo" in code search is https://cs.chromium.org/chromium/src/out/Debug/gen/ash/public/interfaces/media.mojom.h?l=66&ct=xref_jump_to_def&gsn=MediaClientAssociatedPtrInfo which gives an error:Can't load 'chromium/src/out/Debug/gen/ash/public/interfaces/media.mojom.h': Could not resolve path src/out/Debug/gen/ash/public/interfaces/media.mojom.h.This mojom interface is built only for chrome os. Maybe that is why it is not included in the code search?
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMGE5NEgnC-FeGfa6Md1RZXt%3DQmp_Prtm4M1%2B-%3DLJtfGT8S5nA%40mail.gmail.com.
Most Chrome OS code is indexed. Try clicking on methods here:https://cs.chromium.org/chromium/src/chrome/browser/chromeos/upgrade_detector_chromeos.h?l=25I suspect this is a problem specific to mojo, or generated code in general.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGE5NEsammjYYaXvwKDJ2DToQZZ3ytcyGTRU1U5BsuqzXi16g%40mail.gmail.com.
Regarding same-process mojo services:How do we prevent data copies? +Marijn Kruisselbrink is creating the blob mojo service, and ideally when we have data from JS, we can std::move that straight into the blob storage service if it is in the same process.However, the interface generated for methods like this:where we pass a byte array accepts it as a const ref, copying the data. How do we provide our own buffer here to prevent copying when we're in the same process?
However, I do suspect that most of the time, argument data is generated for the express purpose of sending it over IPC, so it's likely that by-value message arguments would be a more efficient default, and we could live with the extra copy in cases where the caller really does need to copy.Of course the big trade-off there is that users are probably far more likely to accidentally copy where it's not necessary.