From 2581e577597dd0f435ae1e6fe918df912bb98248 Mon Sep 17 00:00:00 2001 From: "wtc@chromium.org" Date: Fri, 13 Nov 2009 21:54:55 +0000 Subject: 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 --- webkit/glue/media/buffered_data_source.cc | 4 +++- webkit/glue/media/buffered_data_source.h | 3 ++- webkit/glue/media/simple_data_source.cc | 4 +++- webkit/glue/media/simple_data_source.h | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'webkit/glue/media') diff --git a/webkit/glue/media/buffered_data_source.cc b/webkit/glue/media/buffered_data_source.cc index 48df614..3d2c73f 100644 --- a/webkit/glue/media/buffered_data_source.cc +++ b/webkit/glue/media/buffered_data_source.cc @@ -230,11 +230,13 @@ int64 BufferedResourceLoader::GetBufferedLastBytePosition() { // webkit_glue::ResourceLoaderBridge::Peer implementations bool BufferedResourceLoader::OnReceivedRedirect( const GURL& new_url, - const webkit_glue::ResourceLoaderBridge::ResponseInfo& info) { + const webkit_glue::ResourceLoaderBridge::ResponseInfo& info, + GURL* new_first_party_for_cookies) { DCHECK(bridge_.get()); // Save the new URL. url_ = new_url; + *new_first_party_for_cookies = GURL(); // The load may have been stopped and |start_callback| is destroyed. // In this case we shouldn't do anything. diff --git a/webkit/glue/media/buffered_data_source.h b/webkit/glue/media/buffered_data_source.h index bbab6d6..627f84d 100644 --- a/webkit/glue/media/buffered_data_source.h +++ b/webkit/glue/media/buffered_data_source.h @@ -109,7 +109,8 @@ class BufferedResourceLoader : virtual void OnUploadProgress(uint64 position, uint64 size) {} virtual bool OnReceivedRedirect( const GURL& new_url, - const webkit_glue::ResourceLoaderBridge::ResponseInfo& info); + const webkit_glue::ResourceLoaderBridge::ResponseInfo& info, + GURL* new_first_party_for_cookies); virtual void OnReceivedResponse( const webkit_glue::ResourceLoaderBridge::ResponseInfo& info, bool content_filtered); diff --git a/webkit/glue/media/simple_data_source.cc b/webkit/glue/media/simple_data_source.cc index 0a4c11e..ed2a594 100644 --- a/webkit/glue/media/simple_data_source.cc +++ b/webkit/glue/media/simple_data_source.cc @@ -122,8 +122,10 @@ void SimpleDataSource::OnUploadProgress(uint64 position, uint64 size) {} bool SimpleDataSource::OnReceivedRedirect( const GURL& new_url, - const webkit_glue::ResourceLoaderBridge::ResponseInfo& info) { + const webkit_glue::ResourceLoaderBridge::ResponseInfo& info, + GURL* new_first_party_for_cookies) { SetURL(new_url); + *new_first_party_for_cookies = GURL(); return true; } diff --git a/webkit/glue/media/simple_data_source.h b/webkit/glue/media/simple_data_source.h index c578aa5..3aac41b 100644 --- a/webkit/glue/media/simple_data_source.h +++ b/webkit/glue/media/simple_data_source.h @@ -55,7 +55,8 @@ class SimpleDataSource : public media::DataSource, virtual void OnUploadProgress(uint64 position, uint64 size); virtual bool OnReceivedRedirect( const GURL& new_url, - const webkit_glue::ResourceLoaderBridge::ResponseInfo& info); + const webkit_glue::ResourceLoaderBridge::ResponseInfo& info, + GURL* new_first_party_for_cookies); virtual void OnReceivedResponse( const webkit_glue::ResourceLoaderBridge::ResponseInfo& info, bool content_filtered); -- cgit v1.1