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

Unified Diff: media/blink/buffered_data_source.cc

Issue 1924383002: BufferedDataSource now caches redirects for subsequent requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | media/blink/buffered_data_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/buffered_data_source.cc
diff --git a/media/blink/buffered_data_source.cc b/media/blink/buffered_data_source.cc
index 7b15b11c88b4c902ae687c0c5303262a85939852..c149c8ce5b99f3bd79c052fb61dd1ca813bb96ca 100644
--- a/media/blink/buffered_data_source.cc
+++ b/media/blink/buffered_data_source.cc
@@ -387,7 +387,15 @@ void BufferedDataSource::StartCallback(
loader_->Stop();
return;
}
+
response_original_url_ = loader_->response_original_url();
+ // The response original url is the URL of this resource after following
+ // redirects. Update |url_| to this so that we only follow redirects once for
+ // simplicity and efficiency.
+ // If it's empty, it was a response from a Service Worker, so keep the
hubbe 2016/04/28 19:34:17 Why do we care if it's a service worker?
watk 2016/04/28 20:05:16 I guess my phrasing is slightly misleading. It's n
+ // original URL.
+ if (!response_original_url_.is_empty())
+ url_ = response_original_url_;
// All responses must be successful. Resources that are assumed to be fully
// buffered must have a known content length.
« no previous file with comments | « no previous file | media/blink/buffered_data_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698