Add CefResponse parameter to CefRequestHandler::OnResourceRedirect

This commit is contained in:
Marshall Greenblatt
2016-08-24 16:19:57 +03:00
parent 69334e22c2
commit 3b5fb0d526
8 changed files with 48 additions and 9 deletions

View File

@@ -73,10 +73,14 @@ net::URLRequestJob* CefRequestInterceptor::MaybeInterceptRedirect(
static_cast<CefRequestImpl*>(cefRequest.get())->Set(request);
static_cast<CefRequestImpl*>(cefRequest.get())->SetReadOnly(true);
CefRefPtr<CefResponse> cefResponse = new CefResponseImpl();
static_cast<CefResponseImpl*>(cefResponse.get())->Set(request);
static_cast<CefResponseImpl*>(cefResponse.get())->SetReadOnly(true);
// Give the client an opportunity to redirect the request.
CefString newUrlStr = location.spec();
handler->OnResourceRedirect(browser.get(), frame, cefRequest,
newUrlStr);
cefResponse, newUrlStr);
if (newUrlStr != location.spec()) {
const GURL new_url = GURL(newUrlStr.ToString());
if (!new_url.is_empty() && new_url.is_valid()) {