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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerThread.cpp

Issue 2005433002: [Origin Trials] Install origin trial bindings on V8 context conditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-ef-install
Patch Set: Fix multiple definition of signature; addressing nits Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1b521bc58305b8d4b9f7db3e4605f4e817cdf609..a18aef35f7ab538f0c9c24a65d645d3244732029 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"
@@ -340,8 +341,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,
+ // then inject them into the context now
+ ExecutionContext* executionContext = m_workerGlobalScope->getExecutionContext();
+ if (executionContext) {
+ OriginTrialContext* originTrialContext = OriginTrialContext::from(executionContext);
+ if (originTrialContext)
+ originTrialContext->initializePendingFeatures();
+ }
+ }
}
if (startMode == PauseWorkerGlobalScopeOnStart)
« no previous file with comments | « third_party/WebKit/Source/core/testing/v8/WebCoreTestSupport.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698