Looking to expose HTTP status code through CEF

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.

Looking to expose HTTP status code through CEF

Postby mikeyk730 » Fri Nov 19, 2010 2:17 pm

In my application, I am interested in HTTP status codes. I wish to, say, take custom action to a 403 Forbidden. I'm currently looking to see if this information could be added to handleLoadEnd.

Deep enough in the call stack of handleLoadEnd, I see the status code in:
* WebCore::MainResourceLoader::didFinishLoading as m_response.m_httpStatusCode
* WebCore::FrameLoader::finishedLoading as m_documentLoader->m_response.m_httpStatusCode
I don't see a good way to get this info higher up the call stack.

In CEF, I see the HTTP status code in RequestProxy::OnReceivedResponse and RequestProxy::NotifyReceivedResponse as info->headers->response_code_. I'm not sure how this fits in with other parts of the system yet.

I'm looking for a sensible way to expose the status code. Does anyone know the architecture of responses enough to provide guidance? I'll continue investigating in the meantime.

Thanks,
Mike
mikeyk730
Newbie
 
Posts: 4
Joined: Fri Apr 23, 2010 12:45 pm

Re: Looking to expose HTTP status code through CEF

Postby magreenblatt » Mon Nov 22, 2010 3:29 pm

I agree that passing the HTTP status code to CefHandler::HandleLoadEnd would be best from an API perspective. You may be able to retrieve the HTTP status code in BrowserWebViewDelegate::didFinishLoad via frame->dataSource()->response()->httpStatusCode().

Regards,
Marshall
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 69 guests