Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Side by Side Diff: media/blink/resource_multibuffer_data_provider.cc

Issue 2710023009: media: Stop sending if-match headers for media fetch requests. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/blink/resource_multibuffer_data_provider_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/blink/resource_multibuffer_data_provider.h" 5 #include "media/blink/resource_multibuffer_data_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 FROM_HERE, base::Bind(&ResourceMultiBufferDataProvider::Terminate, 78 FROM_HERE, base::Bind(&ResourceMultiBufferDataProvider::Terminate,
79 weak_factory_.GetWeakPtr())); 79 weak_factory_.GetWeakPtr()));
80 return; 80 return;
81 } 81 }
82 82
83 request.setHTTPHeaderField( 83 request.setHTTPHeaderField(
84 WebString::fromUTF8(net::HttpRequestHeaders::kRange), 84 WebString::fromUTF8(net::HttpRequestHeaders::kRange),
85 WebString::fromUTF8( 85 WebString::fromUTF8(
86 net::HttpByteRange::RightUnbounded(byte_pos()).GetHeaderValue())); 86 net::HttpByteRange::RightUnbounded(byte_pos()).GetHeaderValue()));
87 87
88 if (!url_data_->etag().empty()) { 88 // We would like to send an if-match header with the request to
89 request.setHTTPHeaderField(WebString::fromUTF8("If-Match"), 89 // tell the remote server that we really can't handle files other
90 WebString::fromUTF8(url_data_->etag())); 90 // than the one we already started playing. Unfortunately, doing
91 } 91 // so will disable the http cache, and possibly other proxies
92 // along the way. See crbug/504194 and crbug/689989 for more information.
92 93
93 url_data_->frame()->setReferrerForRequest(request, blink::WebURL()); 94 url_data_->frame()->setReferrerForRequest(request, blink::WebURL());
94 95
95 // Disable compression, compression for audio/video doesn't make sense... 96 // Disable compression, compression for audio/video doesn't make sense...
96 request.setHTTPHeaderField( 97 request.setHTTPHeaderField(
97 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding), 98 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding),
98 WebString::fromUTF8("identity;q=1, *;q=0")); 99 WebString::fromUTF8("identity;q=1, *;q=0"));
99 100
100 // Check for our test WebAssociatedURLLoader. 101 // Check for our test WebAssociatedURLLoader.
101 std::unique_ptr<WebAssociatedURLLoader> loader; 102 std::unique_ptr<WebAssociatedURLLoader> loader;
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 547 }
547 548
548 if (byte_pos() != first_byte_position) { 549 if (byte_pos() != first_byte_position) {
549 return false; 550 return false;
550 } 551 }
551 552
552 return true; 553 return true;
553 } 554 }
554 555
555 } // namespace media 556 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/blink/resource_multibuffer_data_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698