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

Unified Diff: media/blink/url_index.h

Issue 1958123004: fix service worker cross-origin problem in multibuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 7 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 | « media/blink/resource_multibuffer_data_provider_unittest.cc ('k') | media/blink/url_index.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/url_index.h
diff --git a/media/blink/url_index.h b/media/blink/url_index.h
index aec033a5672abe8688785de2a4d55b5914d22069..47969fa9314af83b14648b0102b2c7c5ff44b4c9 100644
--- a/media/blink/url_index.h
+++ b/media/blink/url_index.h
@@ -97,6 +97,12 @@ class MEDIA_BLINK_EXPORT UrlData : public base::RefCounted<UrlData> {
// this is not called regularly.
void Use();
+ // Call this before we add some data to the multibuffer().
+ // If the multibuffer is empty, the data origin is set from
+ // |origin| and returns true. If not, it compares |origin|
+ // to the previous origin and returns wheather they match or not.
+ bool ValidateDataOrigin(const GURL& origin);
+
// Setters.
void set_length(int64_t length);
void set_cacheable(bool cacheable);
@@ -148,6 +154,11 @@ class MEDIA_BLINK_EXPORT UrlData : public base::RefCounted<UrlData> {
// the same url.
const GURL url_;
+ // Origin of the data, should only be different from the url_.GetOrigin()
+ // when service workers are involved.
+ GURL data_origin_;
+ bool have_data_origin_;
+
// Cross-origin access mode.
const CORSMode cors_mode_;
« no previous file with comments | « media/blink/resource_multibuffer_data_provider_unittest.cc ('k') | media/blink/url_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698