| 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 9c58a3545d799b01847495ef26bb4eb3e22080cb..b7fd490c6fa03403314436cdca4d951309f45ef3 100644
|
| --- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| +++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| @@ -519,23 +519,21 @@ void WorkerThread::initializeOnWorkerThread(std::unique_ptr<WorkerThreadStartupD
|
| m_consoleMessageStorage = new ConsoleMessageStorage();
|
| m_globalScope = createWorkerGlobalScope(std::move(startupData));
|
| m_workerInspectorController = WorkerInspectorController::create(this);
|
| - if (globalScope()->isWorkerGlobalScope())
|
| - toWorkerGlobalScope(globalScope())->scriptLoaded(sourceCode.length(), cachedMetaData.get() ? cachedMetaData->size() : 0);
|
|
|
| // Notify proxy that a new WorkerOrWorkletGlobalScope has been created
|
| // and started.
|
| m_workerReportingProxy.workerGlobalScopeStarted(globalScope());
|
|
|
| - WorkerOrWorkletScriptController* scriptController = globalScope()->scriptController();
|
| - if (!scriptController->isExecutionForbidden()) {
|
| - scriptController->initializeContextIfNeeded();
|
| + if (globalScope()->isWorkerGlobalScope())
|
| + m_workerReportingProxy.didLoadWorkerScript(sourceCode.length(), cachedMetaData.get() ? cachedMetaData->size() : 0);
|
| +
|
| + globalScope()->scriptController()->initializeContextIfNeeded();
|
|
|
| - // If Origin Trials have been registered before the V8 context was ready,
|
| - // then inject them into the context now
|
| - OriginTrialContext* originTrialContext = OriginTrialContext::from(globalScope());
|
| - if (originTrialContext)
|
| - originTrialContext->initializePendingFeatures();
|
| - }
|
| + // If Origin Trials have been registered before the V8 context was ready,
|
| + // then inject them into the context now
|
| + OriginTrialContext* originTrialContext = OriginTrialContext::from(globalScope());
|
| + if (originTrialContext)
|
| + originTrialContext->initializePendingFeatures();
|
|
|
| setThreadState(lock, ThreadState::Running);
|
| }
|
| @@ -560,7 +558,6 @@ void WorkerThread::initializeOnWorkerThread(std::unique_ptr<WorkerThreadStartupD
|
| WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(globalScope());
|
| CachedMetadataHandler* handler = workerGlobalScope->createWorkerScriptCachedMetadataHandler(scriptURL, cachedMetaData.get());
|
| bool success = workerGlobalScope->scriptController()->evaluate(ScriptSourceCode(sourceCode, scriptURL), nullptr, handler, v8CacheOptions);
|
| - workerGlobalScope->didEvaluateWorkerScript();
|
| m_workerReportingProxy.didEvaluateWorkerScript(success);
|
| }
|
| }
|
|
|