diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-17 20:30:19 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-17 20:30:19 +0000 |
commit | 3fbc3505b662034fb1bab5b5a8e12732981575fa (patch) | |
tree | e9296c548dad39ed8f281485e524d1c2481c30d1 /webkit/glue/media | |
parent | b4834b7279f42a3e9403956549badcd77c16a89a (diff) | |
download | chromium_src-3fbc3505b662034fb1bab5b5a8e12732981575fa.zip chromium_src-3fbc3505b662034fb1bab5b5a8e12732981575fa.tar.gz chromium_src-3fbc3505b662034fb1bab5b5a8e12732981575fa.tar.bz2 |
Revert 89532 - Not allow compression when requesting multimedia
because ffmpeg does not expect compressed files.
(It does not make sense to compress audio/video anyways...)
http://codereview.chromium.org/7044092
BUG=47381
TEST=http://www.deafmac.org/html5/grinchsample.mp4 (Please clear browser cache, otherwise it can contain original GZIP-ed file requested by old browser)
Review URL: http://codereview.chromium.org/7044092
TBR=enal@chromium.org
Review URL: http://codereview.chromium.org/7205011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/media')
-rw-r--r-- | webkit/glue/media/buffered_resource_loader.cc | 14 | ||||
-rw-r--r-- | webkit/glue/media/buffered_resource_loader_unittest.cc | 15 | ||||
-rw-r--r-- | webkit/glue/media/simple_data_source.cc | 9 |
3 files changed, 5 insertions, 33 deletions
diff --git a/webkit/glue/media/buffered_resource_loader.cc b/webkit/glue/media/buffered_resource_loader.cc index 7829448..eb14351 100644 --- a/webkit/glue/media/buffered_resource_loader.cc +++ b/webkit/glue/media/buffered_resource_loader.cc @@ -8,7 +8,6 @@ #include "base/stringprintf.h" #include "base/string_util.h" #include "net/base/net_errors.h" -#include "net/http/http_request_headers.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" @@ -107,18 +106,13 @@ void BufferedResourceLoader::Start(net::CompletionCallback* start_callback, if (IsRangeRequest()) { range_requested_ = true; - request.setHTTPHeaderField( - WebString::fromUTF8(net::HttpRequestHeaders::kRange), - WebString::fromUTF8(GenerateHeaders(first_byte_position_, - last_byte_position_))); + request.setHTTPHeaderField(WebString::fromUTF8("Range"), + WebString::fromUTF8(GenerateHeaders( + first_byte_position_, + last_byte_position_))); } frame->setReferrerForRequest(request, WebKit::WebURL()); - // Disable compression, compression for audio/video doesn't make sense... - request.setHTTPHeaderField( - WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding), - WebString::fromUTF8("identity;q=1, *;q=0")); - // This flag is for unittests as we don't want to reset |url_loader| if (!keep_test_loader_) url_loader_.reset(frame->createAssociatedURLLoader()); diff --git a/webkit/glue/media/buffered_resource_loader_unittest.cc b/webkit/glue/media/buffered_resource_loader_unittest.cc index df44c48..f23bd89 100644 --- a/webkit/glue/media/buffered_resource_loader_unittest.cc +++ b/webkit/glue/media/buffered_resource_loader_unittest.cc @@ -3,17 +3,14 @@ // found in the LICENSE file. #include <algorithm> -#include <string> #include "base/format_macros.h" #include "base/stringprintf.h" #include "net/base/net_errors.h" -#include "net/http/http_request_headers.h" #include "net/http/http_util.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "webkit/glue/media/buffered_resource_loader.h" @@ -33,7 +30,6 @@ using ::testing::Return; using ::testing::ReturnRef; using ::testing::SetArgumentPointee; using ::testing::StrictMock; -using ::testing::Truly; using ::testing::NiceMock; using ::testing::WithArgs; @@ -69,14 +65,6 @@ ACTION_P(RequestCanceled, loader) { loader->didFail(NULL, error); } -// Predicate that tests that request disallows compressed data. -static bool CorrectAcceptEncoding(const WebKit::WebURLRequest &request) { - std::string value = request.httpHeaderField( - WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding)).utf8(); - return (value.find("identity;q=1") != std::string::npos) && - (value.find("*;q=0") != std::string::npos); -} - class BufferedResourceLoaderTest : public testing::Test { public: BufferedResourceLoaderTest() @@ -110,8 +98,7 @@ class BufferedResourceLoaderTest : public testing::Test { void Start() { InSequence s; - EXPECT_CALL(*url_loader_, loadAsynchronously(Truly(CorrectAcceptEncoding), - loader_.get())); + EXPECT_CALL(*url_loader_, loadAsynchronously(_, loader_.get())); loader_->Start( NewCallback(this, &BufferedResourceLoaderTest::StartCallback), NewCallback(this, &BufferedResourceLoaderTest::NetworkCallback), diff --git a/webkit/glue/media/simple_data_source.cc b/webkit/glue/media/simple_data_source.cc index 57c51ad..6647e52 100644 --- a/webkit/glue/media/simple_data_source.cc +++ b/webkit/glue/media/simple_data_source.cc @@ -9,16 +9,12 @@ #include "media/base/filter_host.h" #include "net/base/data_url.h" #include "net/base/load_flags.h" -#include "net/http/http_request_headers.h" #include "net/url_request/url_request_status.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKitClient.h" -#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "webkit/glue/media/web_data_source_factory.h" #include "webkit/glue/webkit_glue.h" -using WebKit::WebString; - namespace webkit_glue { static const char kDataScheme[] = "data"; @@ -304,11 +300,6 @@ void SimpleDataSource::StartTask() { frame_->setReferrerForRequest(request, WebKit::WebURL()); - // Disable compression, compression for audio/video doesn't make sense... - request.setHTTPHeaderField( - WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding), - WebString::fromUTF8("identity;q=1, *;q=0")); - // This flag is for unittests as we don't want to reset |url_loader| if (!keep_test_loader_) url_loader_.reset(frame_->createAssociatedURLLoader()); |