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_->length() == kPositionNotSpecified && | |
| 89 url_data_->CachedSize() == 0 && url_data_->BytesReadFromCache() == 0) { | |
| 90 // This lets flywheel know that we don't have anything previously cached | |
| 91 // data for this resource. We can only send it if this is the first request | |
| 92 // for this resource. | |
| 93 request.SetHTTPHeaderField(WebString::FromUTF8("chrome-proxy"), | |
|
bengr
2017/04/27 22:10:18
You are unconditionally adding a header that we co
tombergan
2017/04/27 23:02:52
Why does the following code not run into the same
hubbe
2017/04/27 23:16:26
Uses different headers..
hubbe
2017/04/27 23:21:32
Or maybe because it dumps two headers into one fie
| |
| 94 WebString::FromUTF8("frfr")); | |
| 95 } | |
| 96 | |
| 88 // We would like to send an if-match header with the request to | 97 // We would like to send an if-match header with the request to |
| 89 // tell the remote server that we really can't handle files other | 98 // tell the remote server that we really can't handle files other |
| 90 // than the one we already started playing. Unfortunately, doing | 99 // than the one we already started playing. Unfortunately, doing |
| 91 // so will disable the http cache, and possibly other proxies | 100 // so will disable the http cache, and possibly other proxies |
| 92 // along the way. See crbug/504194 and crbug/689989 for more information. | 101 // along the way. See crbug/504194 and crbug/689989 for more information. |
| 93 | 102 |
| 94 url_data_->frame()->SetReferrerForRequest(request, blink::WebURL()); | 103 url_data_->frame()->SetReferrerForRequest(request, blink::WebURL()); |
| 95 | 104 |
| 96 // Disable compression, compression for audio/video doesn't make sense... | 105 // Disable compression, compression for audio/video doesn't make sense... |
| 97 request.SetHTTPHeaderField( | 106 request.SetHTTPHeaderField( |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 } | 559 } |
| 551 | 560 |
| 552 if (byte_pos() != first_byte_position) { | 561 if (byte_pos() != first_byte_position) { |
| 553 return false; | 562 return false; |
| 554 } | 563 } |
| 555 | 564 |
| 556 return true; | 565 return true; |
| 557 } | 566 } |
| 558 | 567 |
| 559 } // namespace media | 568 } // namespace media |
| OLD | NEW |