Index: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp |
index bc0aa71b56102b9bbfda91c855c300135c60e790..26e7519b6eb4c501b09d0184a1cd62134eb30568 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp |
@@ -53,6 +53,7 @@ |
#include "core/loader/DocumentLoader.h" |
#include "core/loader/FrameLoader.h" |
#include "core/loader/FrameLoaderClient.h" |
+#include "core/origin_trials/OriginTrialContext.h" |
#include "platform/Histogram.h" |
#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/ScriptForbiddenScope.h" |
@@ -270,6 +271,14 @@ bool WindowProxy::initialize() |
MainThreadDebugger::instance()->contextCreated(m_scriptState.get(), frame, origin); |
frame->loader().client()->didCreateScriptContext(context, m_world->extensionGroup(), m_world->worldId()); |
} |
+ // If Origin Trials have been registered before the V8 context was ready, |
+ // then inject them into the context now |
+ ExecutionContext* executionContext = m_scriptState->getExecutionContext(); |
+ if (executionContext) { |
+ OriginTrialContext* originTrialContext = OriginTrialContext::from(executionContext); |
+ if (originTrialContext) |
+ originTrialContext->initializePendingTrials(); |
+ } |
return true; |
} |