summaryrefslogtreecommitdiffstats
path: root/webkit/glue/media
diff options
context:
space:
mode:
authoracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-01 01:13:07 +0000
committeracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-01 01:13:07 +0000
commitee33950fa22a463c269fdff084968d05a8e67330 (patch)
tree286cdf7e847988813583e3db7793fecc90596aff /webkit/glue/media
parent2a074201cf68e9bca0c8c7a439d91b13923e533f (diff)
downloadchromium_src-ee33950fa22a463c269fdff084968d05a8e67330.zip
chromium_src-ee33950fa22a463c269fdff084968d05a8e67330.tar.gz
chromium_src-ee33950fa22a463c269fdff084968d05a8e67330.tar.bz2
Revert code that prevents redirecting to different origins because it breaks Vimeo & YouTube.
BUG=74451,72578 TEST=BufferedResourceLoaderTest.HasSingleOrigin(), SimpleDataSourceTest.HasSingleOrigin() Review URL: http://codereview.chromium.org/6596059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/media')
-rw-r--r--webkit/glue/media/buffered_resource_loader.cc6
-rw-r--r--webkit/glue/media/buffered_resource_loader_unittest.cc2
-rw-r--r--webkit/glue/media/simple_data_source.cc9
-rw-r--r--webkit/glue/media/simple_data_source_unittest.cc4
4 files changed, 3 insertions, 18 deletions
diff --git a/webkit/glue/media/buffered_resource_loader.cc b/webkit/glue/media/buffered_resource_loader.cc
index e7354f6..0570075 100644
--- a/webkit/glue/media/buffered_resource_loader.cc
+++ b/webkit/glue/media/buffered_resource_loader.cc
@@ -252,11 +252,7 @@ void BufferedResourceLoader::willSendRequest(
if (single_origin_)
single_origin_ = url_.GetOrigin() == GURL(newRequest.url()).GetOrigin();
- // Enforce same-origin policy and cause redirects to other origins to
- // look like network errors.
- // http://dev.w3.org/html5/spec/Overview.html#concept-media-load-resource
- // http://dev.w3.org/html5/spec/Overview.html#fetch
- if (!single_origin_ || !IsProtocolSupportedForMedia(newRequest.url())) {
+ if (!IsProtocolSupportedForMedia(newRequest.url())) {
// Set the url in the request to an invalid value (empty url).
newRequest.setURL(WebKit::WebURL());
DoneStart(net::ERR_ADDRESS_INVALID);
diff --git a/webkit/glue/media/buffered_resource_loader_unittest.cc b/webkit/glue/media/buffered_resource_loader_unittest.cc
index 158b6dc3..4e0dfef 100644
--- a/webkit/glue/media/buffered_resource_loader_unittest.cc
+++ b/webkit/glue/media/buffered_resource_loader_unittest.cc
@@ -526,7 +526,6 @@ TEST_F(BufferedResourceLoaderTest, HasSingleOrigin) {
// Test redirect to a different domain.
Initialize(kHttpUrl, -1, -1);
Start();
- EXPECT_CALL(*this, StartCallback(net::ERR_ADDRESS_INVALID));
Redirect(kHttpRedirectToDifferentDomainUrl1);
EXPECT_FALSE(loader_->HasSingleOrigin());
StopWhenLoad();
@@ -535,7 +534,6 @@ TEST_F(BufferedResourceLoaderTest, HasSingleOrigin) {
Initialize(kHttpUrl, -1, -1);
Start();
Redirect(kHttpRedirectToSameDomainUrl1);
- EXPECT_CALL(*this, StartCallback(net::ERR_ADDRESS_INVALID));
Redirect(kHttpRedirectToDifferentDomainUrl1);
EXPECT_FALSE(loader_->HasSingleOrigin());
StopWhenLoad();
diff --git a/webkit/glue/media/simple_data_source.cc b/webkit/glue/media/simple_data_source.cc
index fee89fe..48da431 100644
--- a/webkit/glue/media/simple_data_source.cc
+++ b/webkit/glue/media/simple_data_source.cc
@@ -119,15 +119,6 @@ void SimpleDataSource::willSendRequest(
if (single_origin_)
single_origin_ = url_.GetOrigin() == GURL(newRequest.url()).GetOrigin();
- // Enforce same-origin policy and cause redirects to other origins to
- // look like network errors.
- // http://dev.w3.org/html5/spec/Overview.html#concept-media-load-resource
- // http://dev.w3.org/html5/spec/Overview.html#fetch
- if (!single_origin_) {
- DoneInitialization_Locked(false);
- return;
- }
-
url_ = newRequest.url();
}
diff --git a/webkit/glue/media/simple_data_source_unittest.cc b/webkit/glue/media/simple_data_source_unittest.cc
index 125fd33..bfa8e1d 100644
--- a/webkit/glue/media/simple_data_source_unittest.cc
+++ b/webkit/glue/media/simple_data_source_unittest.cc
@@ -254,16 +254,16 @@ TEST_F(SimpleDataSourceTest, HasSingleOrigin) {
// Test redirect to a different domain.
InitializeDataSource(kHttpUrl, media::NewExpectedCallback());
- EXPECT_CALL(host_, SetError(media::PIPELINE_ERROR_NETWORK));
Redirect(kHttpRedirectToDifferentDomainUrl1);
+ RequestSucceeded(false);
EXPECT_FALSE(data_source_->HasSingleOrigin());
DestroyDataSource();
// Test redirect to the same domain and then to a different domain.
InitializeDataSource(kHttpUrl, media::NewExpectedCallback());
Redirect(kHttpRedirectToSameDomainUrl1);
- EXPECT_CALL(host_, SetError(media::PIPELINE_ERROR_NETWORK));
Redirect(kHttpRedirectToDifferentDomainUrl1);
+ RequestSucceeded(false);
EXPECT_FALSE(data_source_->HasSingleOrigin());
DestroyDataSource();
}