Crash in CefResourceRequestJobCallback

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: Crash in CefResourceRequestJobCallback

Postby sjaved » Tue Mar 13, 2018 9:33 am

that is the tricky part I am not understanding :(
to me seems like synchronization problem between request and request job, and how it gets triggered :?: no idea :(
sjaved
Techie
 
Posts: 15
Joined: Wed Jun 15, 2016 3:47 am

Re: Crash in CefResourceRequestJobCallback

Postby magreenblatt » Tue Mar 13, 2018 1:20 pm

You shouldn't need to dig into Chromium internals. Since the CEF sample apps don't crash I suggest you look closely at your implementation as compared to the examples that CEF provides to identify what you might be doing differently.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Crash in CefResourceRequestJobCallback

Postby sjaved » Thu Mar 15, 2018 4:45 am

The problem turns out to be following:
Code: Select all
bool MyResourceHandler::ReadResponse(void* data_out,
    int bytes_to_read, int& bytes_read, CefRefPtr<CefCallback> callback)
{
....
if (has_data) {
       callback->Continue(); // should be only called to defer read response
        return true;
    }
...

callback->continue() should only be called to defer the read response and also bytes_read should be 0 before calling callback->continue().

In my case there was no need to defer the readresponse, hence no need to call callback->Continue().

Thanks all for the help!!

Regards,
sjaved
Techie
 
Posts: 15
Joined: Wed Jun 15, 2016 3:47 am

Previous

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 39 guests