| Index: third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| index e98767bbb1badde01a636a3c9a84cbd2c9d6f94d..b43a6363a6f983d43aabefdbd501cc7ce226d9c0 100644
|
| --- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| +++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| @@ -33,6 +33,7 @@
|
| #include "core/inspector/InspectorInstrumentation.h"
|
| #include "core/inspector/InspectorTaskRunner.h"
|
| #include "core/inspector/WorkerThreadDebugger.h"
|
| +#include "core/origin_trials/OriginTrialContext.h"
|
| #include "core/workers/WorkerBackingThread.h"
|
| #include "core/workers/WorkerClients.h"
|
| #include "core/workers/WorkerReportingProxy.h"
|
| @@ -217,8 +218,18 @@ void WorkerThread::initialize(PassOwnPtr<WorkerThreadStartupData> startupData)
|
| m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get());
|
|
|
| WorkerOrWorkletScriptController* scriptController = m_workerGlobalScope->scriptController();
|
| - if (!scriptController->isExecutionForbidden())
|
| + if (!scriptController->isExecutionForbidden()) {
|
| scriptController->initializeContextIfNeeded();
|
| +
|
| + // If Origin Trials have been registered before the V8 context was ready,
|
| + // then inject them into the context now
|
| + ExecutionContext* executionContext = m_workerGlobalScope->getExecutionContext();
|
| + if (executionContext) {
|
| + OriginTrialContext* originTrialContext = OriginTrialContext::from(executionContext);
|
| + if (originTrialContext)
|
| + originTrialContext->initializePendingTrials();
|
| + }
|
| + }
|
| }
|
|
|
| if (startMode == PauseWorkerGlobalScopeOnStart)
|
|
|