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

Unified Diff: Source/platform/weborigin/SecurityOrigin.h

Issue 594803002: Transfer SecurityOrigin overrides to Workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add tests Created 6 years, 3 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: Source/platform/weborigin/SecurityOrigin.h
diff --git a/Source/platform/weborigin/SecurityOrigin.h b/Source/platform/weborigin/SecurityOrigin.h
index 7112208474fcb51d3926ef00043a085e1fae7de8..ae65c4c61461f5fb49d17ea18483615731ccd6e4 100644
--- a/Source/platform/weborigin/SecurityOrigin.h
+++ b/Source/platform/weborigin/SecurityOrigin.h
@@ -203,6 +203,42 @@ public:
static const String& urlWithUniqueSecurityOrigin();
+ // A SecurityOrigin can be configured/mutated to take global origin
+ // policy constraints and overrides into account. These policy overrides
+ // can be transferred from one SecurityOrigin and applied to another.
+ class PolicyOverrides {
Mike West 2014/09/26 11:29:10 It might be simpler to model this as a struct; the
+ public:
+ PolicyOverrides()
+ : m_grantUniversalAccess(false)
+ , m_enforceFilePathSeparation(false)
+ {
+ }
+
+ PolicyOverrides(bool grantUniversalAccess, bool enforceFilePathSeparation)
+ : m_grantUniversalAccess(grantUniversalAccess)
+ , m_enforceFilePathSeparation(enforceFilePathSeparation)
+ {
+ }
+
+ // Mirrors what SecurityOrigin::grantUniversalAccess() grants.
+ bool grantUniversalAccess() const { return m_grantUniversalAccess; }
+
+ // Mirrors what SecurityOrigin::enforceFilePathSeparation() grants.
+ bool enforceFilePathSeparation() const { return m_enforceFilePathSeparation; }
Mike West 2014/09/26 11:29:10 These both sound a bit strange. Perhaps "doesGrant
+
+ private:
+ bool m_grantUniversalAccess;
+ bool m_enforceFilePathSeparation;
+ };
+
+ // Return the origin policy overrides of this origin.
+ PolicyOverrides policyOverrides() const;
+
+ // Apply the overrides to this origin. Overrides that
+ // are set will be enabled, those that aren't will be
+ // cleared.
+ void applyPolicyOverrides(const PolicyOverrides&);
+
private:
SecurityOrigin();
explicit SecurityOrigin(const KURL&);

Powered by Google App Engine
This is Rietveld 408576698