diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 21:54:55 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 21:54:55 +0000 |
commit | 2581e577597dd0f435ae1e6fe918df912bb98248 (patch) | |
tree | 5d1edc9fe3d12eb1d7da8d8361bc57e5ad4dc397 /webkit/tools | |
parent | dec173b814e09f0633bdfefad7e1d89c50fa4919 (diff) | |
download | chromium_src-2581e577597dd0f435ae1e6fe918df912bb98248.zip chromium_src-2581e577597dd0f435ae1e6fe918df912bb98248.tar.gz chromium_src-2581e577597dd0f435ae1e6fe918df912bb98248.tar.bz2 |
Propagate the "first party for cookies" from WebKit to the network stack
when we follow a redirect, because WebKit's
MainResourceLoader::willSendRequest method may change the "first party for
cookies" URL of the resource request.
R=abarth
BUG=25133
TEST=In Options menu, change cookie policy to "Accept cookies only from
sites I visit" and then follow the instructions in issue 25133 comment 20.
Review URL: http://codereview.chromium.org/385024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/simple_resource_loader_bridge.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index b041921..65f1640 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc @@ -153,9 +153,12 @@ class RequestProxy : public URLRequest::Delegate, void NotifyReceivedRedirect(const GURL& new_url, const ResourceLoaderBridge::ResponseInfo& info) { - if (peer_ && peer_->OnReceivedRedirect(new_url, info)) { + GURL new_first_party_for_cookies; + if (peer_ && peer_->OnReceivedRedirect(new_url, info, + &new_first_party_for_cookies)) { io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( - this, &RequestProxy::AsyncFollowDeferredRedirect)); + this, &RequestProxy::AsyncFollowDeferredRedirect, + new_first_party_for_cookies)); } else { Cancel(); } @@ -238,11 +241,13 @@ class RequestProxy : public URLRequest::Delegate, Done(); } - void AsyncFollowDeferredRedirect() { + void AsyncFollowDeferredRedirect(const GURL& new_first_party_for_cookies) { // This can be null in cases where the request is already done. if (!request_.get()) return; + if (!new_first_party_for_cookies.is_empty()) + request_->set_first_party_for_cookies(new_first_party_for_cookies); request_->FollowDeferredRedirect(); } |