| 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 bd161ca57672b1763897b2e090e86518227c6747..f4a418626623b8341cf30cdc85e7bbf9f6e08290 100644
|
| --- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| +++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
|
| @@ -497,7 +497,13 @@ void WorkerThread::initializeOnWorkerThread(std::unique_ptr<WorkerThreadStartupD
|
| m_workerReportingProxy.didCreateWorkerGlobalScope(globalScope());
|
| m_workerInspectorController = WorkerInspectorController::create(this);
|
|
|
| - globalScope()->scriptController()->initializeContextIfNeeded();
|
| + // TODO(nhiroki): Handle a case where the script controller fails to
|
| + // initialize the context.
|
| + if (globalScope()->scriptController()->initializeContextIfNeeded()) {
|
| + m_workerReportingProxy.didInitializeWorkerContext();
|
| + v8::HandleScope handleScope(isolate());
|
| + Platform::current()->workerContextCreated(globalScope()->scriptController()->context());
|
| + }
|
|
|
| setThreadState(lock, ThreadState::Running);
|
| }
|
| @@ -513,12 +519,6 @@ void WorkerThread::initializeOnWorkerThread(std::unique_ptr<WorkerThreadStartupD
|
| return;
|
| }
|
|
|
| - if (globalScope()->scriptController()->isContextInitialized()) {
|
| - m_workerReportingProxy.didInitializeWorkerContext();
|
| - v8::HandleScope handleScope(isolate());
|
| - Platform::current()->workerContextCreated(globalScope()->scriptController()->context());
|
| - }
|
| -
|
| if (globalScope()->isWorkerGlobalScope()) {
|
| WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(globalScope());
|
| CachedMetadataHandler* handler = workerGlobalScope->createWorkerScriptCachedMetadataHandler(scriptURL, cachedMetaData.get());
|
|
|