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

Unified Diff: media/blink/resource_multibuffer_data_provider.cc

Issue 2338963002: Store, use and send etags. (Closed)
Patch Set: comments addressed Created 4 years, 3 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
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 511b356cfe791352c14e119d58d68004f9ec7cb2..283c264469420b33db9726ad23d4fb7a8da2b3d9 100644
--- a/media/blink/resource_multibuffer_data_provider.cc
+++ b/media/blink/resource_multibuffer_data_provider.cc
@@ -84,6 +84,11 @@ void ResourceMultiBufferDataProvider::Start() {
WebString::fromUTF8(
net::HttpByteRange::RightUnbounded(byte_pos()).GetHeaderValue()));
+ if (!url_data_->etag().empty()) {
+ request.setHTTPHeaderField(WebString::fromUTF8("If-Match"),
+ WebString::fromUTF8(url_data_->etag()));
+ }
+
url_data_->frame()->setReferrerForRequest(request, blink::WebURL());
// Disable compression, compression for audio/video doesn't make sense...
@@ -241,6 +246,9 @@ void ResourceMultiBufferDataProvider::didReceiveResponse(
destination_url_data->set_last_modified(last_modified);
}
+ destination_url_data->set_etag(
+ response.httpHeaderField("ETag").utf8().data());
+
destination_url_data->set_valid_until(base::Time::Now() +
GetCacheValidUntil(response));

Powered by Google App Engine
This is Rietveld 408576698