OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 static_cast<V8CacheOptions>(m_workerStartData.v8CacheOptions); | 454 static_cast<V8CacheOptions>(m_workerStartData.v8CacheOptions); |
455 | 455 |
456 std::unique_ptr<WorkerThreadStartupData> startupData = | 456 std::unique_ptr<WorkerThreadStartupData> startupData = |
457 WorkerThreadStartupData::create( | 457 WorkerThreadStartupData::create( |
458 scriptURL, m_workerStartData.userAgent, m_mainScriptLoader->script(), | 458 scriptURL, m_workerStartData.userAgent, m_mainScriptLoader->script(), |
459 m_mainScriptLoader->releaseCachedMetadata(), startMode, | 459 m_mainScriptLoader->releaseCachedMetadata(), startMode, |
460 document->contentSecurityPolicy()->headers().get(), | 460 document->contentSecurityPolicy()->headers().get(), |
461 m_mainScriptLoader->getReferrerPolicy(), starterOrigin, workerClients, | 461 m_mainScriptLoader->getReferrerPolicy(), starterOrigin, workerClients, |
462 m_mainScriptLoader->responseAddressSpace(), | 462 m_mainScriptLoader->responseAddressSpace(), |
463 m_mainScriptLoader->originTrialTokens(), std::move(workerSettings), | 463 m_mainScriptLoader->originTrialTokens(), std::move(workerSettings), |
464 workerV8Settings, true /* inspectorNetworkCapability */); | 464 workerV8Settings); |
465 | 465 |
466 m_mainScriptLoader.clear(); | 466 m_mainScriptLoader.clear(); |
467 | 467 |
468 // We have a dummy document here for loading but it doesn't really represent | 468 // We have a dummy document here for loading but it doesn't really represent |
469 // the document/frame of associated document(s) for this worker. Here we | 469 // the document/frame of associated document(s) for this worker. Here we |
470 // populate the task runners with null document not to confuse the frame | 470 // populate the task runners with null document not to confuse the frame |
471 // scheduler (which will end up using the thread's default task runner). | 471 // scheduler (which will end up using the thread's default task runner). |
472 m_mainThreadTaskRunners = ParentFrameTaskRunners::create(nullptr); | 472 m_mainThreadTaskRunners = ParentFrameTaskRunners::create(nullptr); |
473 | 473 |
474 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create( | 474 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create( |
475 *this, *document, *m_workerContextClient); | 475 *this, *document, *m_workerContextClient); |
476 m_loaderProxy = WorkerLoaderProxy::create(this); | 476 m_loaderProxy = WorkerLoaderProxy::create(this); |
477 m_workerThread = | 477 m_workerThread = |
478 ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalScopeProxy); | 478 ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalScopeProxy); |
479 m_workerThread->start(std::move(startupData)); | 479 m_workerThread->start(std::move(startupData)); |
480 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), | 480 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), |
481 scriptURL); | 481 scriptURL); |
482 } | 482 } |
483 | 483 |
484 } // namespace blink | 484 } // namespace blink |
OLD | NEW |