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

Unified Diff: Source/core/dom/SecurityContext.cpp

Issue 793493003: Prepare to replicate sandbox flags for OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/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.
+ if (isSandboxed(SandboxOrigin) && securityOrigin() && !securityOrigin()->isUnique()) {
+ setSecurityOrigin(SecurityOrigin::createUnique());
+ didUpdateSecurityOrigin();
+ }
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698