Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 b/504194 and b/689989 for more information. | |
|
Tom Bergan
2017/02/22 22:22:04
s/b/crbug/ ?
| |
| 93 // if (!url_data_->etag().empty()) { | |
| 94 // request.setHTTPHeaderField(WebString::fromUTF8("If-Match"), | |
| 95 // WebString::fromUTF8(url_data_->etag())); | |
| 96 // } | |
| 92 | 97 |
| 93 url_data_->frame()->setReferrerForRequest(request, blink::WebURL()); | 98 url_data_->frame()->setReferrerForRequest(request, blink::WebURL()); |
| 94 | 99 |
| 95 // Disable compression, compression for audio/video doesn't make sense... | 100 // Disable compression, compression for audio/video doesn't make sense... |
| 96 request.setHTTPHeaderField( | 101 request.setHTTPHeaderField( |
| 97 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding), | 102 WebString::fromUTF8(net::HttpRequestHeaders::kAcceptEncoding), |
| 98 WebString::fromUTF8("identity;q=1, *;q=0")); | 103 WebString::fromUTF8("identity;q=1, *;q=0")); |
| 99 | 104 |
| 100 // Check for our test WebAssociatedURLLoader. | 105 // Check for our test WebAssociatedURLLoader. |
| 101 std::unique_ptr<WebAssociatedURLLoader> loader; | 106 std::unique_ptr<WebAssociatedURLLoader> loader; |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 546 } | 551 } |
| 547 | 552 |
| 548 if (byte_pos() != first_byte_position) { | 553 if (byte_pos() != first_byte_position) { |
| 549 return false; | 554 return false; |
| 550 } | 555 } |
| 551 | 556 |
| 552 return true; | 557 return true; |
| 553 } | 558 } |
| 554 | 559 |
| 555 } // namespace media | 560 } // namespace media |
| OLD | NEW |