CEF crashes during startup

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.

Re: CEF crashes during startup

Postby magreenblatt » Thu Mar 19, 2015 2:17 pm

edominic wrote:Since when, do I have to do this way?
Before 1750, it worked the way I showed.

A separate helper executable has always been required for CEF3. Are you building a single executable and then copying it to multiple locations? If so you need to check the return value of CefExecuteProcess.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes during startup

Postby edominic » Thu Mar 19, 2015 2:47 pm

We are using a seperate helper (Helper EH).
I placed it in ./Frameworks/cefclient Helper EH.app/ .... (dont know exactly the path)
The path to the application is set in browser_subprocess_path.

The return value of CefExecuteProcess is -1
edominic
Mentor
 
Posts: 82
Joined: Fri Mar 13, 2015 6:46 am

Re: CEF crashes during startup

Postby magreenblatt » Thu Mar 19, 2015 3:26 pm

edominic wrote:The return value of CefExecuteProcess is -1

It won't be -1 in the helper executable, hence the need to check it in your code. See the documentation on CefExecuteProcess.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes during startup

Postby edominic » Thu Mar 19, 2015 3:32 pm

I edited code a bit:
Code: Select all
            CefRefPtr<XYZCefClientApp> j_application(new XYZCefClientApp());

            int exit_code = CefExecuteProcess(j_args, j_application.get(), NULL);

            if (exit_code >= 0) {
                return exit_code;
            }

            bool cefinit = CefInitialize(j_args, j_cefsettings, j_application.get(), NULL);

            CefRefPtr<CefClient> j_client(new XYZCefClient());


Here is subprocess path set per jni:
Code: Select all
CefString(&j_cefsettings.browser_subprocess_path) = GetStringFromJNI(env, j_browser_subprocess_path);


return value on work was -1, so far I remember
edominic
Mentor
 
Posts: 82
Joined: Fri Mar 13, 2015 6:46 am

Re: CEF crashes during startup

Postby edominic » Fri Mar 20, 2015 8:43 am

Do I have to build Helper executable on my own?

I always extracted it from cefclient target (at the moment from cef_binary_3.1750.1738_macosx32)

Some additional information:
Our main application is written in java
in java we load our jnilib
afterwards we set (over jni) :
- CefSettings like browser_subprocess_path ...
- CefBrowserSettings like web_security, application_cache ...
- CefWindow like size
and then we call a method for initialization with start url (in jnilib):
Code: Select all
#if !OS_WIN

            CefRefPtr<XYZCefClientApp> j_application(new XYZCefClientApp());

            bool cefinit = CefInitialize(j_args, j_cefsettings, j_application.get(), NULL);
/*
            int exit_code = CefExecuteProcess(j_args, j_application.get(), NULL);

            if (exit_code >= 0) {
                return exit_code;
            }
*/
            CefRefPtr<CefClient> j_client(new XYZCefClient());

            try {
                j_browser = CefBrowserHost::CreateBrowserSync(j_windowInfo,
                        j_client,
                        j_start_url,
                        j_browserSettings,
                        0L);

            }
            catch (ExceptionHandler e) {
                return JNI_FALSE;
            }

#endif

    CefRunMessageLoop();

    CefShutdown();


If I look into Activity Monitor, there is one process called "cefclient Helper EH" which comes from my application.
edominic
Mentor
 
Posts: 82
Joined: Fri Mar 13, 2015 6:46 am

Re: CEF crashes during startup

Postby magreenblatt » Fri Mar 20, 2015 11:52 am

edominic wrote:Do I have to build Helper executable on my own?

I always extracted it from cefclient target (at the moment from cef_binary_3.1750.1738_macosx32)

That should be OK. Except then you won't be able to register an extension because the registration needs to occur in the renderer process, and the renderer process is run by the helper executable.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes during startup

Postby edominic » Fri Mar 20, 2015 11:56 am

So I need to implement OnWebKitInitialized in helper executable?
edominic
Mentor
 
Posts: 82
Joined: Fri Mar 13, 2015 6:46 am

Re: CEF crashes during startup

Postby magreenblatt » Fri Mar 20, 2015 12:08 pm

edominic wrote:So I need to implement OnWebKitInitialized in helper executable?

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

Re: CEF crashes during startup

Postby edominic » Sat Mar 21, 2015 5:32 am

Thanks ;)
And how does communication between helper executable and jnilib works?
edominic
Mentor
 
Posts: 82
Joined: Fri Mar 13, 2015 6:46 am

Re: CEF crashes during startup

Postby magreenblatt » Mon Mar 23, 2015 10:15 am

You can look at how the JCEF project works: https://bitbucket.org/chromiumembedded/java-cef/
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

PreviousNext

Return to Support Forum

Who is online

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