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

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: all tests pass 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
Index: media/blink/url_index.h
diff --git a/media/blink/url_index.h b/media/blink/url_index.h
index aec033a5672abe8688785de2a4d55b5914d22069..f6ff0b4163790e56314cd739b1fa7effbe374ad7 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 weather they match or not.
DaleCurtis 2016/05/10 00:16:08 s/weather/whether/
hubbe 2016/05/10 22:33:23 Done.
+ 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_;

Powered by Google App Engine
This is Rietveld 408576698