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

Unified Diff: media/blink/resource_multibuffer_data_provider.cc

Issue 2842763003: media: Send chrome-cache: frfr on first request. (Closed)
Patch Set: merge 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/blink/multibuffer_data_source.cc ('k') | media/blink/resource_multibuffer_data_provider_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/resource_multibuffer_data_provider.cc
diff --git a/media/blink/resource_multibuffer_data_provider.cc b/media/blink/resource_multibuffer_data_provider.cc
index a1e1878bb5cb968ffe677eb1f2d8374f4c45e98d..18a8847fda2ec2cf63f94eac7bc763ea12af1d7e 100644
--- a/media/blink/resource_multibuffer_data_provider.cc
+++ b/media/blink/resource_multibuffer_data_provider.cc
@@ -85,6 +85,15 @@ void ResourceMultiBufferDataProvider::Start() {
WebString::FromUTF8(
net::HttpByteRange::RightUnbounded(byte_pos()).GetHeaderValue()));
+ if (url_data_->length() == kPositionNotSpecified &&
+ url_data_->CachedSize() == 0 && url_data_->BytesReadFromCache() == 0) {
+ // This lets the data reduction proxy know that we don't have anything
+ // previously cached data for this resource. We can only send it if this is
+ // the first request for this resource.
+ request.SetHTTPHeaderField(WebString::FromUTF8("chrome-proxy"),
+ WebString::FromUTF8("frfr"));
+ }
+
// We would like to send an if-match header with the request to
// tell the remote server that we really can't handle files other
// than the one we already started playing. Unfortunately, doing
« no previous file with comments | « media/blink/multibuffer_data_source.cc ('k') | media/blink/resource_multibuffer_data_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698