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

Unified Diff: media/blink/buffered_data_source.h

Issue 1220963004: Check the response URL origin in BufferedDataSource to avoid mixing cross-origin responses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated hubbe's comment Created 5 years, 5 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/buffered_data_source.h
diff --git a/media/blink/buffered_data_source.h b/media/blink/buffered_data_source.h
index 32f14816fcdce5a3307fb8a898c965d67f2b2c7d..fd85b7cc524e3e79395313e3e59ed33015bcf250 100644
--- a/media/blink/buffered_data_source.h
+++ b/media/blink/buffered_data_source.h
@@ -159,6 +159,9 @@ class MEDIA_EXPORT BufferedDataSource : public DataSource {
// when accessing ranges that are outside initial buffered region).
void PartialReadStartCallback(BufferedResourceLoader::Status status);
+ // Returns true if we can accept the new partial response.
+ bool CheckPartialResponseURL(const GURL& partial_response_original_url) const;
+
// BufferedResourceLoader callbacks.
void ReadCallback(BufferedResourceLoader::Status status, int bytes_read);
void LoadingStateChangedCallback(BufferedResourceLoader::LoadingState state);
@@ -238,6 +241,13 @@ class MEDIA_EXPORT BufferedDataSource : public DataSource {
DownloadingCB downloading_cb_;
+ // The original URL of the first response. If the request is redirected to
+ // another URL it is the URL after redirected. If the response is generated in
+ // a Service Worker this URL is empty. BufferedDataSource checks the original
+ // URL of each successive response. If the origin URL of it is different from
+ // the original URL of the first response, it is treated as an error.
+ GURL response_original_url_;
+
// Disallow rebinding WeakReference ownership to a different thread by keeping
// a persistent reference. This avoids problems with the thread-safety of
// reaching into this class from multiple threads to attain a WeakPtr.
« no previous file with comments | « no previous file | media/blink/buffered_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698