diff options
author | rob@robwu.nl <rob@robwu.nl@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-26 10:41:16 +0000 |
---|---|---|
committer | rob@robwu.nl <rob@robwu.nl@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-26 10:41:16 +0000 |
commit | 5f71413b4cefc6db3f111b2da1681266e3c056ec (patch) | |
tree | f137d56cdc889d2d411c55bbe59a402abbff95b0 /android_webview/browser | |
parent | 1615f14112858597ccff27f6acab09be19dc40d7 (diff) | |
download | chromium_src-5f71413b4cefc6db3f111b2da1681266e3c056ec.zip chromium_src-5f71413b4cefc6db3f111b2da1681266e3c056ec.tar.gz chromium_src-5f71413b4cefc6db3f111b2da1681266e3c056ec.tar.bz2 |
Support redirectUrl at onHeadersReceived in WebRequest / DWR API
Add support for extension-initiated redirects via the (declarative) Web Request API.
The existing URL validation and conflict resolution logic of redirectUrl at onBeforeRequest is re-used for the implementation of redirectUrl at onHeadersReceived.
To make sure that redirects to data:// and chrome-extension:// URLs are not blocked, a new parameter has been added to the network delegate (allowed_unsafe_redirect_url).
BUG=280464,115940
TEST=browser_tests: ExtensionWebRequestApiTest.WebRequestBlocking:ExtensionWebRequestApiTest.WebRequestDeclarative1
unit_tests: ExtensionWebRequestTest.*:WebRequestActionWithThreadsTest.*
net_unittests: URLRequestTestHTTP.NetworkDelegateRedirectRequestOnHeadersReceived*: URLRequestTestHTTP.UnsafeRedirect*: URLRequestTestHTTP.*ReferenceFragment*
Review URL: https://codereview.chromium.org/154473002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/browser')
-rw-r--r-- | android_webview/browser/net/aw_network_delegate.cc | 3 | ||||
-rw-r--r-- | android_webview/browser/net/aw_network_delegate.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/android_webview/browser/net/aw_network_delegate.cc b/android_webview/browser/net/aw_network_delegate.cc index c5aef1f..a18226c 100644 --- a/android_webview/browser/net/aw_network_delegate.cc +++ b/android_webview/browser/net/aw_network_delegate.cc @@ -45,7 +45,8 @@ int AwNetworkDelegate::OnHeadersReceived( net::URLRequest* request, const net::CompletionCallback& callback, const net::HttpResponseHeaders* original_response_headers, - scoped_refptr<net::HttpResponseHeaders>* override_response_headers) { + scoped_refptr<net::HttpResponseHeaders>* override_response_headers, + GURL* allowed_unsafe_redirect_url) { return net::OK; } diff --git a/android_webview/browser/net/aw_network_delegate.h b/android_webview/browser/net/aw_network_delegate.h index 6d344698..7b78dda 100644 --- a/android_webview/browser/net/aw_network_delegate.h +++ b/android_webview/browser/net/aw_network_delegate.h @@ -30,8 +30,8 @@ class AwNetworkDelegate : public net::NetworkDelegate { net::URLRequest* request, const net::CompletionCallback& callback, const net::HttpResponseHeaders* original_response_headers, - scoped_refptr<net::HttpResponseHeaders>* override_response_headers) - OVERRIDE; + scoped_refptr<net::HttpResponseHeaders>* override_response_headers, + GURL* allowed_unsafe_redirect_url) OVERRIDE; virtual void OnBeforeRedirect(net::URLRequest* request, const GURL& new_location) OVERRIDE; virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |