How to send information from chromium code to cefapp

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

How to send information from chromium code to cefapp

Postby isabellaSwift » Mon Jun 19, 2023 9:58 am

I have a cef based application.
I have some information in renderer folder of chromium code and I want to pass this information to browser process of my cef application.

I want to do it through mojo ipc. That is I want to be able to send a message from renderer process to browser process.

I have referred this document for implementing the same - https://chromium.googlesource.com/chrom ... ervices.md

Based on this document I have done the implementation as following -
1) The interface example.mojom is in chromium code.
2) sending the data from renderer forlder in chromium using mojo::Remote.
3) binding in cef application code using BindNewPipeAndPassReceiver() and GetBrowserInterfaceBroker()
4) receiving the data in cef code by writing a implementation of the example interface.

The files that are auto-generated by mojom are also present in chromium code.

The problem with this is -
since my interface (example.mojom), pendingReceiver,BinderRegistry are present in chromium code, I need to add a include in cef application.
This causes various linker errors.

So can someone please help with this scenario. I wanted to understand if the places where I have kept the files is right ?

( If I keep the receiver code that is implementation of the example interface in browser folder in chromium then it works fine. But I want to receive data in my cef application directly. )
isabellaSwift
Newbie
 
Posts: 2
Joined: Mon Jun 19, 2023 9:54 am

Re: How to send information from chromium code to cefapp

Postby magreenblatt » Mon Jun 19, 2023 10:38 am

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: How to send information from chromium code to cefapp

Postby isabellaSwift » Mon Jun 19, 2023 11:06 am

@magreenblatt this seems to be using cefcallback. Can we use mojo for this purpose ?
isabellaSwift
Newbie
 
Posts: 2
Joined: Mon Jun 19, 2023 9:54 am

Re: How to send information from chromium code to cefapp

Postby magreenblatt » Mon Jun 19, 2023 11:12 am

It is not currently possible to use mojo directly in a CEF app.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 196 guests