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

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

Issue 1723753002: Make Document::isSecureContext() work for OOPIFs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout test tweaks, remove unnecessarily #include Created 4 years, 10 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: third_party/WebKit/Source/core/dom/SecurityContext.cpp
diff --git a/third_party/WebKit/Source/core/dom/SecurityContext.cpp b/third_party/WebKit/Source/core/dom/SecurityContext.cpp
index a37ff6b8230baa1b56ff5bf886d6a06243d97da4..a2c268fea4930670288335a8d4b1bd5588566c91 100644
--- a/third_party/WebKit/Source/core/dom/SecurityContext.cpp
+++ b/third_party/WebKit/Source/core/dom/SecurityContext.cpp
@@ -74,10 +74,16 @@ bool SecurityContext::isSecureTransitionTo(const KURL& url) const
void SecurityContext::enforceSandboxFlags(SandboxFlags mask)
{
+ // The security origin must be set already in order to determine a sandboxed origin's potential trustworthiness.
+ ASSERT(securityOrigin());
m_sandboxFlags |= mask;
- if (isSandboxed(SandboxOrigin) && securityOrigin() && !securityOrigin()->isUnique()) {
- setSecurityOrigin(SecurityOrigin::createUnique());
+ if (isSandboxed(SandboxOrigin) && !securityOrigin()->isUnique()) {
+ // Before overwriting the original origin, compute secure
+ // context properties from it. These properties are used to do
+ // secure context checks involving unique origins in remote
+ // frames.
+ setSecurityOrigin(SecurityOrigin::createUnique(securityOrigin()->isPotentiallyTrustworthy(), securityOrigin()->isPotentiallyTrustworthy() && securityOrigin()->bypassSecureContextCheck()));
didUpdateSecurityOrigin();
}
}

Powered by Google App Engine
This is Rietveld 408576698