OnWebKitInitialized and OnProcessMessageReceived not invoked

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.

OnWebKitInitialized and OnProcessMessageReceived not invoked

Postby sepviz » Thu Oct 09, 2014 6:01 am

Hi,
I'm trying to modify the cefsimple example on mac with CEF3. I send a message in the OnLoadEnd method of the browser process, and it returns true, but it seems that the OnWebKitInitialized and OnProcessMessageReceived methods of the renderer process are never invoked.

I modified process_helper_mac.cpp to invoke CefExecuteProcess(main_args, <MY_APP>, NULL) and I can see with logging that the constructor of <MY_APP> is correctly invoked, as well as the GetRenderProcessHandler and OnRenderThreadCreated methods. However, no other method of this object is invoked (it implements CefApp, CefRenderProcessHandler and CefBrowserProcessHandler, and I put logging in all methods). I am obviously missing something but I don't know where to look at.

What are the required steps to have OnProcessMessageReceived invoked when sending a message to the renderer process?
sepviz
Newbie
 
Posts: 3
Joined: Thu Oct 09, 2014 5:32 am

Re: OnWebKitInitialized and OnProcessMessageReceived not inv

Postby magreenblatt » Thu Oct 09, 2014 12:02 pm

What CEF3 version are you using? How are you logging? It's hard to say what you're doing wrong without looking at your code. Can you post it?
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: OnWebKitInitialized and OnProcessMessageReceived not inv

Postby sepviz » Fri Oct 10, 2014 2:45 am

I use the prebuilt package for mac 64 bits CEF 3.1916.1857 found on cefbuilds.com. For logging, I open a file in append mode, write to it and close it everytime I want to log something.

What I'm trying to do is to port to mac an app that already works fine on Linux and Windows. Since the architecture is a bit different for mac, the code for Linux/Windows has been successfully modified to use a separate process helper, so that we don't have to make any modification to our code when porting it to mac.

i have attached a zip file containing the main classes. I have removed most of the non-CEF related code from it. To run this on mac, I use PayloadEditor from the main entry point and JavaScriptApp in the secondary entry point. Let me know if you need more details.
Attachments
cef3_mac.zip
(3.82 KiB) Downloaded 361 times
sepviz
Newbie
 
Posts: 3
Joined: Thu Oct 09, 2014 5:32 am

Re: OnWebKitInitialized and OnProcessMessageReceived not inv

Postby magreenblatt » Fri Oct 10, 2014 9:26 am

sepviz wrote:For logging, I open a file in append mode, write to it and close it everytime I want to log something.

This may not work due to sub-process sandbox restrictions. Try adding the `--no-sandbox` command-line flag.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: OnWebKitInitialized and OnProcessMessageReceived not inv

Postby sepviz » Tue Oct 14, 2014 12:48 am

It worked indeed with this option. Since it was possible to log from some methods of this class, I had incorrectly assumed that there was no sandboxing issue.

Thanks!
sepviz
Newbie
 
Posts: 3
Joined: Thu Oct 09, 2014 5:32 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 79 guests