Chromium Code Reviews| Index: Source/core/dom/SecurityContext.cpp |
| diff --git a/Source/core/dom/SecurityContext.cpp b/Source/core/dom/SecurityContext.cpp |
| index 68a4d5992527ea9812bbc2e0afda2baa78fd1a44..2b7d6266e1221f4fe7a01f85240e6dc876b4ac14 100644 |
| --- a/Source/core/dom/SecurityContext.cpp |
| +++ b/Source/core/dom/SecurityContext.cpp |
| @@ -34,6 +34,7 @@ namespace blink { |
| SecurityContext::SecurityContext() |
| : m_haveInitializedSecurityOrigin(false) |
| + , m_sandboxFlags(SandboxNone) |
| { |
| } |
| @@ -64,4 +65,15 @@ bool SecurityContext::isSecureTransitionTo(const KURL& url) const |
| return securityOrigin()->canAccess(other.get()); |
| } |
| +void SecurityContext::enforceSandboxFlags(SandboxFlags mask) |
| +{ |
| + m_sandboxFlags |= mask; |
| + |
| + // The SandboxOrigin is stored redundantly in the security origin. |
|
dcheng
2015/01/08 00:44:59
This comment reads really strangely. It also seems
Nate Chapin
2015/01/08 17:10:52
Yeah, removing.
|
| + if (isSandboxed(SandboxOrigin) && securityOrigin() && !securityOrigin()->isUnique()) { |
| + setSecurityOrigin(SecurityOrigin::createUnique()); |
| + didUpdateSecurityOrigin(); |
| + } |
| +} |
| + |
| } |