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

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

Issue 2842763003: media: Send chrome-cache: frfr on first request. (Closed)
Patch Set: remove header when not sending to proxy Created 3 years, 7 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
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_->length() == kPositionNotSpecified &&
89 url_data_->CachedSize() == 0 && url_data_->BytesReadFromCache() == 0) {
90 // This lets flywheel know that we don't have anything previously cached
bengr 2017/05/03 21:37:42 In code we call this the data reduction proxy, not
hubbe 2017/05/05 20:51:45 Done.
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"),
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698