mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Implement improvements for request handling (issue #1327).
- Add a new CefRequestHandler::OnResourceResponse() method for inspecting the request/response headers and potentially restarting or redirecting the request. - Add a new CefRequest::GetIdentifier() method for tracking a request across multiple CefRequestHandler callbacks. - Pass a CefRequest object instead of just the old URL to CefRequestHandler::OnResourceRedirect(). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2073 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -165,16 +165,31 @@ class CefRequestHandler : public virtual CefBase {
|
||||
}
|
||||
|
||||
///
|
||||
// Called on the IO thread when a resource load is redirected. The |old_url|
|
||||
// parameter will contain the old URL. The |new_url| parameter will contain
|
||||
// the new URL and can be changed if desired.
|
||||
// Called on the IO thread when a resource load is redirected. The |request|
|
||||
// parameter will contain the old URL and other request-related information.
|
||||
// The |new_url| parameter will contain the new URL and can be changed if
|
||||
// desired. The |request| object cannot be modified in this callback.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnResourceRedirect(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
const CefString& old_url,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefString& new_url) {}
|
||||
|
||||
///
|
||||
// Called on the IO thread when a resource response is received. To allow the
|
||||
// resource to load normally return false. To redirect or retry the resource
|
||||
// modify |request| (url, headers or post body) and return true. The
|
||||
// |response| object cannot be modified in this callback.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool OnResourceResponse(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefRequest> request,
|
||||
CefRefPtr<CefResponse> response) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
// Called on the IO thread when the browser needs credentials from the user.
|
||||
// |isProxy| indicates whether the host is a proxy server. |host| contains the
|
||||
|
Reference in New Issue
Block a user