2 CefBrowser communicating

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.

2 CefBrowser communicating

Postby magnor » Tue Jan 08, 2013 8:01 am

Hi,

I have 2 instances of CefBrowser ( created with browser = CefBrowserHost::CreateBrowserSync(...) ). They both load a html page that will via javascript send messages to each other.
I have the javascript bindings working and I get everything to work in single_process mode but I cant figure out how I shall send the processmessages to the other process.

Can anyone give me some pointers? I have searched this forum alot now.

Thanks in advance!
magnor
Newbie
 
Posts: 2
Joined: Thu Dec 20, 2012 12:48 am

Re: 2 CefBrowser communicating

Postby magreenblatt » Wed Jan 09, 2013 7:22 pm

Are you using CefBrowser::SendProcessMessage? What isn't working for you?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: 2 CefBrowser communicating

Postby magnor » Thu Jan 10, 2013 4:08 am

Yes I am using SendProcessMessage via CefBrowser.
I am sending the message from my V8Handler class using the CefBrowser from the current context. First I send to PID_BROWSER which is recevied by my ClientHandler class. This class then sends a message to PID_RENDERER. My CefRenderProcessHandler then gets that message.
I have 2 CefBrowser started ( which means the executable is started 3 times in task manager) and it seems that the CefRenderProcessHandler that gets the message only know of one of the two CefBrowsers. I save a reference in each call to OnBrowserCreated.
So the result is that my js binding only gets called back to the CefBrowser instance that started the call.

Think of it like I am trying to do a chat program between two html pages.
magnor
Newbie
 
Posts: 2
Joined: Thu Dec 20, 2012 12:48 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 189 guests