Issues in generating bindings | Message pipe

29 views
Skip to first unread message

Chandan Kharbanda

unread,
Mar 21, 2017, 2:48:32 PM3/21/17
to chromium-mojo, Akash Agrawall
Hello,

I am trying to send a msg from (browser) "src/net/url_request/url_request_http_job.cc"  to  (renderer) "src/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp".
I am trying to use mojo message pipes for that. I am following https://www.chromium.org/developers/design-documents/mojo .

I made a sample.mojom file and placed it under "components/metrics/leak_detector". 
How do I generate sample_imp.cc & sample_imp.h  ?

I added sample.mojom to the list of sources in mojom("interfaces") in leak_detector/BUILD.gn . Running "gn gen out/Default" and then compiling does not produce any sample_imp.h and simple_imp.cc .

What do I need to add in BUILD.gn under "components/metrics/leak_detector" ?

Thanks,
Chandan

Colin Blundell

unread,
Mar 22, 2017, 6:06:40 AM3/22/17
to Chandan Kharbanda, chromium-mojo, Akash Agrawall
Please post a link to your CL.

Thanks,

Colin
 

Thanks,
Chandan

--
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/7c50b778-4f9e-4c50-9762-e93aad0c62b7%40chromium.org.

Chandan Kharbanda

unread,
Mar 22, 2017, 7:32:06 AM3/22/17
to Colin Blundell, chromium-mojo, Akash Agrawall
Hey,

Please find the diff for BUILD.gn and leak_detector_monitor.mojom .


leak_detector_monitor_imp.h & leak_detector_monitor_imp.cc are not getting created after running "gn gen out/Default" and compiling.

Regards,
Chandan


On Wed, Mar 22, 2017 at 3:36 PM, Colin Blundell <blun...@chromium.org> wrote:
On Tue, Mar 21, 2017 at 7:48 PM Chandan Kharbanda <chandan.k...@gmail.com> wrote:
Hello,

I am trying to send a msg from (browser) "src/net/url_request/url_request_http_job.cc"  to  (renderer) "src/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp".
I am trying to use mojo message pipes for that. I am following https://www.chromium.org/developers/design-documents/mojo .

I made a sample.mojom file and placed it under "components/metrics/leak_detector". 
How do I generate sample_imp.cc & sample_imp.h  ?

I added sample.mojom to the list of sources in mojom("interfaces") in leak_detector/BUILD.gn . Running "gn gen out/Default" and then compiling does not produce any sample_imp.h and simple_imp.cc .

What do I need to add in BUILD.gn under "components/metrics/leak_detector" ?

Please post a link to your CL.

Thanks,

Colin
 

Thanks,
Chandan

--
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.

Colin Blundell

unread,
Mar 22, 2017, 7:34:01 AM3/22/17
to Chandan Kharbanda, Colin Blundell, chromium-mojo, Akash Agrawall
On Wed, Mar 22, 2017 at 12:32 PM Chandan Kharbanda <chandan.k...@gmail.com> wrote:
Hey,

Please find the diff for BUILD.gn and leak_detector_monitor.mojom .


leak_detector_monitor_imp.h & leak_detector_monitor_imp.cc are not getting created after running "gn gen out/Default" and compiling.


What is your compilation command?
 
Regards,
Chandan


On Wed, Mar 22, 2017 at 3:36 PM, Colin Blundell <blun...@chromium.org> wrote:
On Tue, Mar 21, 2017 at 7:48 PM Chandan Kharbanda <chandan.k...@gmail.com> wrote:
Hello,

I am trying to send a msg from (browser) "src/net/url_request/url_request_http_job.cc"  to  (renderer) "src/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp".
I am trying to use mojo message pipes for that. I am following https://www.chromium.org/developers/design-documents/mojo .

I made a sample.mojom file and placed it under "components/metrics/leak_detector". 
How do I generate sample_imp.cc & sample_imp.h  ?

I added sample.mojom to the list of sources in mojom("interfaces") in leak_detector/BUILD.gn . Running "gn gen out/Default" and then compiling does not produce any sample_imp.h and simple_imp.cc .

What do I need to add in BUILD.gn under "components/metrics/leak_detector" ?

Please post a link to your CL.

Thanks,

Colin
 

Thanks,
Chandan

--
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.

--
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.

Colin Blundell

unread,
Mar 22, 2017, 7:35:27 AM3/22/17
to Colin Blundell, Chandan Kharbanda, chromium-mojo, Akash Agrawall
On Wed, Mar 22, 2017 at 12:33 PM Colin Blundell <blun...@chromium.org> wrote:
On Wed, Mar 22, 2017 at 12:32 PM Chandan Kharbanda <chandan.k...@gmail.com> wrote:
Hey,

Please find the diff for BUILD.gn and leak_detector_monitor.mojom .


leak_detector_monitor_imp.h & leak_detector_monitor_imp.cc are not getting created after running "gn gen out/Default" and compiling.


What is your compilation command?

and your platform?

Chandan Kharbanda

unread,
Mar 22, 2017, 7:39:06 AM3/22/17
to Colin Blundell, chromium-mojo, Akash Agrawall
My compilation command is "ninja -C out/Default chrome" and my platform is macOS .

 
 
Regards,
Chandan



Thanks,
Chandan
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.

--
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.

Colin Blundell

unread,
Mar 22, 2017, 7:41:14 AM3/22/17
to Chandan Kharbanda, Colin Blundell, chromium-mojo, Akash Agrawall
On Wed, Mar 22, 2017 at 12:39 PM Chandan Kharbanda <chandan.k...@gmail.com> wrote:
My compilation command is "ninja -C out/Default chrome" and my platform is macOS .

//components/metrics/leak_detector is ChromeOS-only (you can see that in the BUILD.gn file, where everything is wrapped in an if (is_chromeos)).
 

 
 
Regards,
Chandan



Thanks,
Chandan
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.

--
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.

Chandan Kharbanda

unread,
Mar 22, 2017, 7:44:13 AM3/22/17
to Colin Blundell, chromium-mojo, Akash Agrawall
Given my use case what do you suggest ?
Where should I add my .mojom file and how to compile it ?

 
 
Regards,
Chandan



Thanks,
Chandan
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.

--
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.

--
You received this message because you are subscribed to a topic in the Google Groups "chromium-mojo" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-mojo/a7htY8Si-rc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-mojo+unsubscribe@chromium.org.

To post to this group, send email to chromi...@chromium.org.

Colin Blundell

unread,
Mar 22, 2017, 9:51:06 AM3/22/17
to Chandan Kharbanda, Colin Blundell, chromium-mojo, Akash Agrawall
On Wed, Mar 22, 2017 at 12:44 PM Chandan Kharbanda <chandan.k...@gmail.com> wrote:
Given my use case what do you suggest ?
Where should I add my .mojom file and how to compile it ?


//net/interfaces might be a good place to start.
 
 
 
Regards,
Chandan



Thanks,
Chandan
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.

--
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.

--
You received this message because you are subscribed to a topic in the Google Groups "chromium-mojo" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-mojo/a7htY8Si-rc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-moj...@chromium.org.

Chandan Kharbanda

unread,
Mar 22, 2017, 10:09:58 AM3/22/17
to Colin Blundell, chromium-mojo, Akash Agrawall
I will try that. Thanks Colin. 

 
 
Regards,
Chandan



Thanks,
Chandan
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-mojo+unsubscribe@chromium.org.

--
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.

--
You received this message because you are subscribed to a topic in the Google Groups "chromium-mojo" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-mojo/a7htY8Si-rc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-mojo+unsubscribe@chromium.org.

Chandan Kharbanda

unread,
Mar 23, 2017, 6:46:33 AM3/23/17
to Colin Blundell, chromium-mojo, Akash Agrawall
Hi Colin,

I tried adding my mojom file to net/interfaces. Had some success as I was able to create `/out/Default/gen/net/interfaces/corp_data_sharing.mojom.cc` and other compiled files. Thanks :)

I am struggling with binding and creating a class for implementation. I am following this : https://www.chromium.org/developers/design-documents/mojo.

Where do I put my implementation file and how do I compile it (like in which BUILD.gn I need to add it) ?

Here is my current diff : http://pastebin.com/A58iVp3N .

Thanks,
Chandan


Colin Blundell

unread,
Mar 23, 2017, 8:37:05 AM3/23/17
to Chandan Kharbanda, Colin Blundell, chromium-mojo, Akash Agrawall
On Thu, Mar 23, 2017 at 11:46 AM Chandan Kharbanda <chandan.k...@gmail.com> wrote:
Hi Colin,

I tried adding my mojom file to net/interfaces. Had some success as I was able to create `/out/Default/gen/net/interfaces/corp_data_sharing.mojom.cc` and other compiled files. Thanks :)

I am struggling with binding and creating a class for implementation. I am following this : https://www.chromium.org/developers/design-documents/mojo.

Where do I put my implementation file and how do I compile it (like in which BUILD.gn I need to add it) ?

I suggest that you study some existing examples in the codebase (just search around for .mojom files and go on from there to where they're referenced, implemented, where those implementation files are referenced, etc). 
 
 
Regards,
Chandan



Thanks,
Chandan
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.

--
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.

--
You received this message because you are subscribed to a topic in the Google Groups "chromium-mojo" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/chromium-mojo/a7htY8Si-rc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chromium-moj...@chromium.org.

--
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.

Akash Agrawall

unread,
Mar 24, 2017, 2:18:12 PM3/24/17
to Colin Blundell, Chandan Kharbanda, chromium-mojo
cc'ing chromium-mojo group.

On Fri, Mar 24, 2017 at 11:45 PM Akash Agrawall <akash.ag...@gmail.com> wrote:
Hi Collin,

I and Chandan are working together on this.
We were able to write the implementation file and compile it successfully. Thanks for the guidance.

However, when we try to use mojom to send message from:
/src/net/url_request/url_request_http_job.cc
we are getting an error.

Please find the code and errors received here: http://pastebin.com/tSVWWJmw 

Please mention if we are missing anything here.

Thanks and Regards,
Akash Agrawall

Colin Blundell

unread,
Mar 27, 2017, 3:15:01 AM3/27/17
to Akash Agrawall, Colin Blundell, Chandan Kharbanda, chromium-mojo
Hi,

I think you're going to have do some exploring on your own as your use case seems pretty custom, apologies.

Akash Agrawall

unread,
Mar 28, 2017, 12:50:53 AM3/28/17
to Colin Blundell, chromium-mojo, Chandan Kharbanda
Hi,

Tried following multiple documents and codes, still didn't get much luck.

It will be great if you can point to an existing MoJo implementation. We would just need it to transfer "Raw Data (String)" from "src/net/url_request/url_request_http_job.cc" to "src/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp"

Thanks and Regards,
Akash Agrawall

Colin Blundell

unread,
Mar 28, 2017, 3:26:36 AM3/28/17
to Akash Agrawall, Colin Blundell, chromium-mojo, Chandan Kharbanda
One thing you might want to do is start by augmenting an existing Mojo interface (e.g., adding a new method, implementing it to do some logging printouts, and calling it from some existing client of the interface). You can then incrementally expand out from there to try to realize your full ambitions.

Akash Agrawall

unread,
Mar 28, 2017, 4:55:30 AM3/28/17
to Colin Blundell, chromium-mojo, Chandan Kharbanda
Got it. Will try that. Thanks :) 

We made some progress on implementation of Mojo from scratch. Followed this documentation: https://goo.gl/A6rnaa 
Used GetProxy instead of MakeRequest now. I am not getting any syntactical errors now. However, I am getting this error: 

Codes:

Kindly mention if you have an idea about the error.

Akash Agrawall

unread,
Mar 28, 2017, 5:33:26 AM3/28/17
to Colin Blundell, shi...@chromium.org, chromium-mojo, Chandan Kharbanda
Hi Shimazu,

Followed your documentation here: https://goo.gl/A6rnaa to implement Mojo but I am facing an error. 

Kindly mention if you have an idea about the error.

Thanks and Regards,
Akash Agrawall
Reply all
Reply to author
Forward
0 new messages