Chromium Code Reviews| 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&); |