From fdcea1583c4727f6dee378d5b60cd602c57cedbb Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 16 Feb 2012 20:13:44 +0000 Subject: [PATCH] Merge revision 502 changes: - Setting the OnBeforeResourceLoad redirectUrl value should behave the same as using request->SetURL() (issue #529). git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/963@503 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser_resource_loader_bridge.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/libcef/browser_resource_loader_bridge.cc b/libcef/browser_resource_loader_bridge.cc index 347373c17..90dc2f4f3 100644 --- a/libcef/browser_resource_loader_bridge.cc +++ b/libcef/browser_resource_loader_bridge.cc @@ -470,10 +470,10 @@ class RequestProxy : public net::URLRequest::Delegate, if (!handled) { // Observe URL from request. const std::string requestUrl(request->GetURL()); - if(requestUrl != originalUrl) { + if (requestUrl != originalUrl) params->url = GURL(requestUrl); - redirectUrl.clear(); // Request URL trumps redirect URL - } + else if (!redirectUrl.empty()) + params->url = GURL(std::string(redirectUrl)); // Observe method from request. params->method = request->GetMethod(); @@ -504,14 +504,6 @@ class RequestProxy : public net::URLRequest::Delegate, OnCompletedRequest( URLRequestStatus(URLRequestStatus::CANCELED, net::ERR_ABORTED), std::string(), base::Time()); - } else if (!redirectUrl.empty()) { - // redirect to the specified URL - handled = true; - - params->url = GURL(std::string(redirectUrl)); - ResourceResponseInfo info; - bool defer_redirect; - OnReceivedRedirect(params->url, info, &defer_redirect); } else if (resourceStream.get()) { // load from the provided resource stream handled = true;