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

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

Issue 799923006: Make canNavigate() OOPI-friendly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address dcheng's comments Created 6 years 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.
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();
+ }
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698