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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 provideServiceWorkerGlobalScopeClientToWorker(workerClients, ServiceWorkerGl
obalScopeClientImpl::create(*m_workerContextClient)); | 410 provideServiceWorkerGlobalScopeClientToWorker(workerClients, ServiceWorkerGl
obalScopeClientImpl::create(*m_workerContextClient)); |
411 provideServiceWorkerContainerClientToWorker(workerClients, wrapUnique(m_work
erContextClient->createServiceWorkerProvider())); | 411 provideServiceWorkerContainerClientToWorker(workerClients, wrapUnique(m_work
erContextClient->createServiceWorkerProvider())); |
412 | 412 |
413 // We need to set the CSP to both the shadow page's document and the Service
WorkerGlobalScope. | 413 // We need to set the CSP to both the shadow page's document and the Service
WorkerGlobalScope. |
414 document->initContentSecurityPolicy(m_mainScriptLoader->releaseContentSecuri
tyPolicy()); | 414 document->initContentSecurityPolicy(m_mainScriptLoader->releaseContentSecuri
tyPolicy()); |
415 if (!m_mainScriptLoader->referrerPolicy().isNull()) | 415 if (!m_mainScriptLoader->referrerPolicy().isNull()) |
416 document->parseAndSetReferrerPolicy(m_mainScriptLoader->referrerPolicy()
); | 416 document->parseAndSetReferrerPolicy(m_mainScriptLoader->referrerPolicy()
); |
417 | 417 |
418 KURL scriptURL = m_mainScriptLoader->url(); | 418 KURL scriptURL = m_mainScriptLoader->url(); |
419 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); | 419 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); |
| 420 std::unique_ptr<WorkerSettings> workerSettings = wrapUnique(new WorkerSettin
gs(document->settings())); |
420 | 421 |
421 std::unique_ptr<WorkerThreadStartupData> startupData = WorkerThreadStartupDa
ta::create( | 422 std::unique_ptr<WorkerThreadStartupData> startupData = WorkerThreadStartupDa
ta::create( |
422 scriptURL, | 423 scriptURL, |
423 m_workerStartData.userAgent, | 424 m_workerStartData.userAgent, |
424 m_mainScriptLoader->script(), | 425 m_mainScriptLoader->script(), |
425 m_mainScriptLoader->releaseCachedMetadata(), | 426 m_mainScriptLoader->releaseCachedMetadata(), |
426 startMode, | 427 startMode, |
427 document->contentSecurityPolicy()->headers().get(), | 428 document->contentSecurityPolicy()->headers().get(), |
428 m_mainScriptLoader->referrerPolicy(), | 429 m_mainScriptLoader->referrerPolicy(), |
429 starterOrigin, | 430 starterOrigin, |
430 workerClients, | 431 workerClients, |
431 m_mainScriptLoader->responseAddressSpace(), | 432 m_mainScriptLoader->responseAddressSpace(), |
432 m_mainScriptLoader->originTrialTokens(), | 433 m_mainScriptLoader->originTrialTokens(), |
| 434 std::move(workerSettings), |
433 static_cast<V8CacheOptions>(m_workerStartData.v8CacheOptions)); | 435 static_cast<V8CacheOptions>(m_workerStartData.v8CacheOptions)); |
434 | 436 |
435 m_mainScriptLoader.clear(); | 437 m_mainScriptLoader.clear(); |
436 | 438 |
437 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 439 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
438 m_loaderProxy = WorkerLoaderProxy::create(this); | 440 m_loaderProxy = WorkerLoaderProxy::create(this); |
439 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); | 441 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); |
440 m_workerThread->start(std::move(startupData)); | 442 m_workerThread->start(std::move(startupData)); |
441 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 443 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
442 } | 444 } |
443 | 445 |
444 } // namespace blink | 446 } // namespace blink |
OLD | NEW |