In my cef3-based project I need to execute JS-supplied callbacks in the main/visible frame (or frames? or maybe just the frame that has input focus) when events are received in native code in the browser process (basically I want to receive input events in JS from a generic USB HID input device that is being polled on a separate thread in the browser process), but I'm having some trouble wrapping my head around how to make this work. I've read the JS integration docs and I understand that I need to get a reference to the V8 context and the supplied JS function (that handles the events) by exposing a 'register' function (http://code.google.com/p/chromiumembedd ... _Callbacks).
Since the registering and calling of this callback all happens in the render process, I am facing some difficulty on how to make the connection from the browser process to the render process, it seems I will need to send a process message (to PID_RENDERER), but I'm not sure how to make this go to the correct render process, or how to figure out if the current render process is for a frame that has input focus (but from the chromium docs on their multiprocess architecture, I gather that there is also not necessarily a one-to-one mapping between frames and render processes)
I've tried to look at the cefclient application but I keep getting lost or end up going in circles (it doesn't help that I'm a bit new to C++/Multi-threaded programming).
Hopefully someone here can give me some pointers on the correct way to go about this
EDIT: Oops, I didn't pay attention what board I was posting to; this post should probably be moved to the support forum