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

Unified Diff: media/blink/buffered_data_source.cc

Issue 1947693003: BufferedDataSource now caches redirects for subsequent requests on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
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 8dd6b900a6693d5bc077391905f8cbe19bd2aba9..432655d079129a12591e0234e4e64bac13c6a244 100644
--- a/media/blink/buffered_data_source.cc
+++ b/media/blink/buffered_data_source.cc
@@ -11,6 +11,7 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/single_thread_task_runner.h"
+#include "build/build_config.h"
#include "media/base/media_log.h"
#include "net/base/net_errors.h"
@@ -386,7 +387,19 @@ void BufferedDataSource::StartCallback(
loader_->Stop();
return;
}
+
response_original_url_ = loader_->response_original_url();
+#if defined(OS_ANDROID)
+ // The response original url is the URL of this resource after following
+ // redirects. Update |url_| to this so that we only follow redirects once.
+ // We do this on Android only to preserve the behavior we had before the
+ // unified media pipeline. This behavior will soon exist on all platforms
+ // as we switch to MultiBufferDataSource (http://crbug.com/514719).
+ // If the response URL is empty (which happens when it's from a Service
+ // Worker), keep the original one.
+ if (!response_original_url_.is_empty())
+ url_ = response_original_url_;
+#endif // defined(OS_ANDROID)
// 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