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 09d432d27e07d2e84d786d659f64ba7650f45ca3..3df140c7362ec736053bd73ae7e565ecc1c62bbb 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" |
@@ -345,8 +346,18 @@ void WorkerThread::initializeOnWorkerThread(PassOwnPtr<WorkerThreadStartupData> |
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, |
haraken
2016/05/27 00:01:42
I'm just curious but how can we enable origin-tria
iclelland
2016/05/27 03:19:43
Yes, all resources can now be sent with an HTTP he
|
+ // 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) |