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

Unified Diff: content/renderer/media/android/media_info_loader.cc

Issue 485023003: Use range request for CORS access check on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use range request. Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/media_info_loader.cc
diff --git a/content/renderer/media/android/media_info_loader.cc b/content/renderer/media/android/media_info_loader.cc
index 3c22389e46e259e06265eb931cd9f29ec40cced1..696f83fd7b04b27b7c2a07bb24c5ae7bf5ce2898 100644
--- a/content/renderer/media/android/media_info_loader.cc
+++ b/content/renderer/media/android/media_info_loader.cc
@@ -50,6 +50,12 @@ void MediaInfoLoader::Start(blink::WebFrame* frame) {
request.setRequestContext(WebURLRequest::RequestContextVideo);
frame->setReferrerForRequest(request, blink::WebURL());
+ // Since we don't actually care about the media data at this time, use a one
+ // byte range request to avoid unnecessarily downloading resources. Not all
+ // servers support HEAD unfortunately, so use a range request; which is no
+ // worse than the previous request+cancel code. See http://crbug.com/400788
+ request.addHTTPHeaderField("Range", "bytes=0-1");
acolwell GONE FROM CHROMIUM 2014/08/25 19:40:08 nit: This is a 2 byte range request. Please update
DaleCurtis 2014/08/25 19:43:18 Done.
+
scoped_ptr<WebURLLoader> loader;
if (test_loader_) {
loader = test_loader_.Pass();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698