Request with own CefResourceHandler canceled

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.

Request with own CefResourceHandler canceled

Postby RenderMonkey » Wed Oct 07, 2015 11:14 am

Hello everyone, my first post here! :)

We have a CefResourceHandler that intercepts http://locahost/ requests for fetching for instance files from the local machine.
In branch 2357 this seemed to work well for us but now that we have migrated to 2454 our ReadResponse never gets to transfer the entire content of our larger files and OnLoadError is called in our hander with ERR_ABORTED.

Code: Select all
   .exe!Handler::OnLoadError(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, cef_errorcode_t errorCode, const CefStringBase<CefStringTraitsUTF16> & errorText, const CefStringBase<CefStringTraitsUTF16> & failedUrl) Line 528   C++
    .exe!`anonymous namespace'::load_handler_on_load_error(_cef_load_handler_t * self, _cef_browser_t * browser, _cef_frame_t * frame, cef_errorcode_t errorCode, const _cef_string_utf16_t * errorText, const _cef_string_utf16_t * failedUrl) Line 116   C++
    libcef.dll!CefLoadHandlerCToCpp::OnLoadError(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, cef_errorcode_t errorCode, const CefStringBase<CefStringTraitsUTF16> & errorText, const CefStringBase<CefStringTraitsUTF16> & failedUrl) Line 117   C++
    libcef.dll!CefBrowserHostImpl::OnLoadError(CefRefPtr<CefFrame> frame, const GURL & url, int error_code, const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & error_description) Line 3206   C++
    libcef.dll!CefBrowserHostImpl::DidFailProvisionalLoad(content::RenderFrameHost * render_frame_host, const GURL & validated_url, int error_code, const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > & error_description, bool was_ignored_by_handler) Line 2761   C++
    libcef.dll!content::WebContentsImpl::DidFailProvisionalLoadWithError(content::RenderFrameHostImpl * render_frame_host, const FrameHostMsg_DidFailProvisionalLoadWithError_Params & params) Line 2772   C++
    libcef.dll!content::NavigatorImpl::DidFailProvisionalLoadWithError(content::RenderFrameHostImpl * render_frame_host, const FrameHostMsg_DidFailProvisionalLoadWithError_Params & params) Line 210   C++
    libcef.dll!content::RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(const FrameHostMsg_DidFailProvisionalLoadWithError_Params & params) Line 773   C++
    libcef.dll!base::DispatchToMethodImpl<content::RenderFrameHostImpl,void (__thiscall content::RenderFrameHostImpl::*)(FrameHostMsg_DidFailProvisionalLoadWithError_Params const &),FrameHostMsg_DidFailProvisionalLoadWithError_Params,0>(content::RenderFrameHostImpl * obj, void (const FrameHostMsg_DidFailProvisionalLoadWithError_Params &) * method, const base::Tuple<FrameHostMsg_DidFailProvisionalLoadWithError_Params> & arg, base::IndexSequence<0> __formal) Line 254   C++
    libcef.dll!base::DispatchToMethod<content::RenderFrameHostImpl,void (__thiscall content::RenderFrameHostImpl::*)(FrameHostMsg_DidFailProvisionalLoadWithError_Params const &),FrameHostMsg_DidFailProvisionalLoadWithError_Params>(content::RenderFrameHostImpl * obj, void (const FrameHostMsg_DidFailProvisionalLoadWithError_Params &) * method, const base::Tuple<FrameHostMsg_DidFailProvisionalLoadWithError_Params> & arg) Line 261   C++
    libcef.dll!FrameHostMsg_DidFailProvisionalLoadWithError::Dispatch<content::RenderFrameHostImpl,content::RenderFrameHostImpl,void,void (__thiscall content::RenderFrameHostImpl::*)(FrameHostMsg_DidFailProvisionalLoadWithError_Params const &)>(const IPC::Message * msg, content::RenderFrameHostImpl * obj, content::RenderFrameHostImpl * sender, void * parameter, void (const FrameHostMsg_DidFailProvisionalLoadWithError_Params &) * func) Line 694   C++
    libcef.dll!content::RenderFrameHostImpl::OnMessageReceived(const IPC::Message & msg) Line 384   C++
    libcef.dll!content::RenderProcessHostImpl::OnMessageReceived(const IPC::Message & msg) Line 1567   C++
    libcef.dll!IPC::ChannelProxy::Context::OnDispatchMessage(const IPC::Message & message) Line 294   C++
    libcef.dll!base::internal::RunnableAdapter<void (__thiscall IPC::ChannelProxy::Context::*)(IPC::Message const &)>::Run(IPC::ChannelProxy::Context * object, const IPC::Message & <args_0>) Line 176   C++
    libcef.dll!base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter<void (__thiscall IPC::ChannelProxy::Context::*)(IPC::Message const &)>,base::internal::TypeList<IPC::ChannelProxy::Context * const &,IPC::Message const &> >::MakeItSo(base::internal::RunnableAdapter<void (__thiscall IPC::ChannelProxy::Context::*)(IPC::Message const &)> runnable, IPC::ChannelProxy::Context * const & <args_0>, const IPC::Message & <args_1>) Line 294   C++
    libcef.dll!base::internal::Invoker<base::IndexSequence<0,1>,base::internal::BindState<base::internal::RunnableAdapter<void (__thiscall IPC::ChannelProxy::Context::*)(IPC::Message const &)>,void __cdecl(IPC::ChannelProxy::Context *,IPC::Message const &),base::internal::TypeList<IPC::ChannelProxy::Context *,IPC::Message> >,base::internal::TypeList<base::internal::UnwrapTraits<IPC::ChannelProxy::Context *>,base::internal::UnwrapTraits<IPC::Message> >,base::internal::InvokeHelper<0,void,base::internal::RunnableAdapter<void (__thiscall IPC::ChannelProxy::Context::*)(IPC::Message const &)>,base::internal::TypeList<IPC::ChannelProxy::Context * const &,IPC::Message const &> >,void __cdecl(void)>::Run(base::internal::BindStateBase * base) Line 346   C++
    libcef.dll!base::Callback<void __cdecl(void)>::Run() Line 396   C++
    libcef.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, const char * run_function, const base::PendingTask & pending_task) Line 64   C++
    libcef.dll!base::MessageLoop::RunTask(const base::PendingTask & pending_task) Line 469   C++
    libcef.dll!base::MessageLoop::DeferOrRunPendingTask(const base::PendingTask & pending_task) Line 479   C++
    libcef.dll!base::MessageLoop::DoWork() Line 588   C++
    libcef.dll!base::MessagePumpForUI::DoRunLoop() Line 184   C++
    libcef.dll!base::MessagePumpWin::RunWithDispatcher(base::MessagePump::Delegate * delegate, base::MessagePumpDispatcher * dispatcher) Line 51   C++
    libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Line 58   C++
    libcef.dll!base::MessageLoop::RunHandler() Line 432   C++
    libcef.dll!base::RunLoop::Run() Line 56   C++
    libcef.dll!base::MessageLoop::Run() Line 282   C++
    libcef.dll!CefBrowserMessageLoop::RunMessageLoop() Line 28   C++
    libcef.dll!CefRunMessageLoop() Line 183   C++
    libcef.dll!cef_run_message_loop() Line 300   C++
    .exe!CefRunMessageLoop() Line 291   C++
    .exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 104   C++


Is this a known issue or are we missing something?
Thanks for the help!
RenderMonkey
Techie
 
Posts: 25
Joined: Wed Oct 07, 2015 10:52 am

Re: Request with own CefResourceHandler canceled

Postby magreenblatt » Wed Oct 07, 2015 11:36 am

Where does the request handled by your CefResourceHandler originate from? What size transfer is it failing on? How much data does it transfer successfully before it fails?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Request with own CefResourceHandler canceled

Postby RenderMonkey » Wed Oct 07, 2015 12:23 pm

From html/js located on the machine running cef. Right now if we for instance just load the start page from CefBrowserHost::CreateBrowser with a URL with http://localhost that requests a .mp4 file it fails while a small jpg loads normally.
Sorry I am no longer at work so I currently can't say how much of the data got transfered or how big the files are but the test .mp4 video is around 1 MB I believe. The ReadResponse callback was called 5-15 times before OnLoadError I believe. I can provide more details tomorrow!
RenderMonkey
Techie
 
Posts: 25
Joined: Wed Oct 07, 2015 10:52 am

Re: Request with own CefResourceHandler canceled

Postby RenderMonkey » Thu Oct 08, 2015 1:45 am

Hello again.
This seems to be related to the type of content loaded. I tried loading jpes of varying sizes (0.25 - 20MB) and they all loaded without issue. When I try to load
any of our .mp4 files (smallest being 375KB) it always fails. The amount of bytes successfully transfered varies. For the main test .mp4 file I have been using OnLoadError is usually triggered after around the 18th iteration (but it varies) of ReadResponse. Tthe file is 1150189 bytes so the 18th iteration means 32768 * 18 = 5898242 bytes transfered. What is interesting is that the ReadResponse callback is still called after on OnLoadError is called and is called until the entire content has been transfered.

All suggestions are very welcome :)
RenderMonkey
Techie
 
Posts: 25
Joined: Wed Oct 07, 2015 10:52 am

Re: Request with own CefResourceHandler canceled

Postby RenderMonkey » Thu Oct 08, 2015 7:18 am

Hello again,
The issue has been resolved - it was a chromium build issue that we had missed so we didn't have the proper codec support.
Sorry for all the fuss! :)
RenderMonkey
Techie
 
Posts: 25
Joined: Wed Oct 07, 2015 10:52 am


Return to Support Forum

Who is online

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