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

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

Issue 27073003: CSP Suborigins Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 6 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/ExecutionContext.cpp
diff --git a/Source/core/dom/ExecutionContext.cpp b/Source/core/dom/ExecutionContext.cpp
index 66f959be67681166437f2a512776afc29bd1c10b..0bdeec8c67fe553924d3b5be62b11b43dd8bf453 100644
--- a/Source/core/dom/ExecutionContext.cpp
+++ b/Source/core/dom/ExecutionContext.cpp
@@ -66,6 +66,7 @@ public:
ExecutionContext::ExecutionContext()
: m_client(0)
, m_sandboxFlags(SandboxNone)
+ , m_suboriginName("")
abarth-chromium 2014/07/31 04:56:47 We should just let this automatically initialize t
jww 2014/10/21 23:51:06 No longer relevant (m_suboriginName is gone).
, m_circularSequentialID(0)
, m_inDispatchErrorEvent(false)
, m_activeDOMObjectsAreSuspended(false)
@@ -336,6 +337,17 @@ void ExecutionContext::enforceSandboxFlags(SandboxFlags mask)
}
}
+void ExecutionContext::enforceSuborigin(const String& name)
+{
+ RELEASE_ASSERT(m_client);
+ SecurityOrigin* origin = m_client->securityContext().securityOrigin();
+ ASSERT(origin);
+ if (!origin->hasSuborigin()) {
+ origin->addSuborigin(name);
+ m_client->didUpdateSecurityOrigin();
+ }
+}
+
void ExecutionContext::trace(Visitor* visitor)
{
#if ENABLE(OILPAN)

Powered by Google App Engine
This is Rietveld 408576698