| Index: Source/core/dom/ExecutionContext.cpp
|
| diff --git a/Source/core/dom/ExecutionContext.cpp b/Source/core/dom/ExecutionContext.cpp
|
| index 5abde3878489ee2166a8fe0a3988a17fbe8b2a69..ed79927892bebb3e3743430203b92859f454e8d1 100644
|
| --- a/Source/core/dom/ExecutionContext.cpp
|
| +++ b/Source/core/dom/ExecutionContext.cpp
|
| @@ -37,6 +37,7 @@
|
| #include "core/page/WindowFocusAllowedIndicator.h"
|
| #include "core/workers/WorkerGlobalScope.h"
|
| #include "core/workers/WorkerThread.h"
|
| +#include "platform/RuntimeEnabledFeatures.h"
|
| #include "wtf/MainThread.h"
|
|
|
| namespace blink {
|
| @@ -226,6 +227,20 @@ bool ExecutionContext::isWindowInteractionAllowed() const
|
| return m_windowInteractionTokens > 0 || WindowFocusAllowedIndicator::windowFocusAllowed();
|
| }
|
|
|
| +// |name| should be non-empty, and this should be enforced by parsing.
|
| +void ExecutionContext::enforceSuborigin(const String& name)
|
| +{
|
| + if (name.isNull())
|
| + return;
|
| + ASSERT(!name.isEmpty());
|
| + ASSERT(RuntimeEnabledFeatures::suboriginsEnabled());
|
| + SecurityOrigin* origin = securityContext().securityOrigin();
|
| + ASSERT(origin);
|
| + ASSERT(!origin->hasSuborigin() || origin->suboriginName() == name);
|
| + origin->addSuborigin(name);
|
| + securityContext().didUpdateSecurityOrigin();
|
| +}
|
| +
|
| DEFINE_TRACE(ExecutionContext)
|
| {
|
| #if ENABLE(OILPAN)
|
|
|