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 26 matching lines...) Expand all Loading... |
37 #include "core/fetch/SubstituteData.h" | 37 #include "core/fetch/SubstituteData.h" |
38 #include "core/frame/csp/ContentSecurityPolicy.h" | 38 #include "core/frame/csp/ContentSecurityPolicy.h" |
39 #include "core/inspector/ConsoleMessage.h" | 39 #include "core/inspector/ConsoleMessage.h" |
40 #include "core/inspector/InspectorInstrumentation.h" | 40 #include "core/inspector/InspectorInstrumentation.h" |
41 #include "core/loader/FrameLoadRequest.h" | 41 #include "core/loader/FrameLoadRequest.h" |
42 #include "core/workers/WorkerClients.h" | 42 #include "core/workers/WorkerClients.h" |
43 #include "core/workers/WorkerGlobalScope.h" | 43 #include "core/workers/WorkerGlobalScope.h" |
44 #include "core/workers/WorkerInspectorProxy.h" | 44 #include "core/workers/WorkerInspectorProxy.h" |
45 #include "core/workers/WorkerLoaderProxy.h" | 45 #include "core/workers/WorkerLoaderProxy.h" |
46 #include "core/workers/WorkerScriptLoader.h" | 46 #include "core/workers/WorkerScriptLoader.h" |
| 47 #include "core/workers/WorkerSettings.h" |
47 #include "core/workers/WorkerThreadStartupData.h" | 48 #include "core/workers/WorkerThreadStartupData.h" |
48 #include "modules/serviceworkers/ServiceWorkerContainerClient.h" | 49 #include "modules/serviceworkers/ServiceWorkerContainerClient.h" |
49 #include "modules/serviceworkers/ServiceWorkerThread.h" | 50 #include "modules/serviceworkers/ServiceWorkerThread.h" |
50 #include "platform/Histogram.h" | 51 #include "platform/Histogram.h" |
51 #include "platform/SharedBuffer.h" | 52 #include "platform/SharedBuffer.h" |
52 #include "platform/heap/Handle.h" | 53 #include "platform/heap/Handle.h" |
53 #include "platform/network/ContentSecurityPolicyParsers.h" | 54 #include "platform/network/ContentSecurityPolicyParsers.h" |
54 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" | 55 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" |
55 #include "platform/network/NetworkUtils.h" | 56 #include "platform/network/NetworkUtils.h" |
56 #include "platform/weborigin/SecurityOrigin.h" | 57 #include "platform/weborigin/SecurityOrigin.h" |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 DCHECK(!m_askedToTerminate); | 401 DCHECK(!m_askedToTerminate); |
401 | 402 |
402 Document* document = m_mainFrame->frame()->document(); | 403 Document* document = m_mainFrame->frame()->document(); |
403 | 404 |
404 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) | 405 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) |
405 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); | 406 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); |
406 | 407 |
407 WorkerClients* workerClients = WorkerClients::create(); | 408 WorkerClients* workerClients = WorkerClients::create(); |
408 provideContentSettingsClientToWorker(workerClients, std::move(m_contentSetti
ngsClient)); | 409 provideContentSettingsClientToWorker(workerClients, std::move(m_contentSetti
ngsClient)); |
409 provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create())
; | 410 provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create())
; |
| 411 provideWorkerSettingsToWorker(workerClients, WorkerSettings::create(document
->settings())); |
410 provideServiceWorkerGlobalScopeClientToWorker(workerClients, ServiceWorkerGl
obalScopeClientImpl::create(*m_workerContextClient)); | 412 provideServiceWorkerGlobalScopeClientToWorker(workerClients, ServiceWorkerGl
obalScopeClientImpl::create(*m_workerContextClient)); |
411 provideServiceWorkerContainerClientToWorker(workerClients, wrapUnique(m_work
erContextClient->createServiceWorkerProvider())); | 413 provideServiceWorkerContainerClientToWorker(workerClients, wrapUnique(m_work
erContextClient->createServiceWorkerProvider())); |
412 | 414 |
413 // We need to set the CSP to both the shadow page's document and the Service
WorkerGlobalScope. | 415 // We need to set the CSP to both the shadow page's document and the Service
WorkerGlobalScope. |
414 document->initContentSecurityPolicy(m_mainScriptLoader->releaseContentSecuri
tyPolicy()); | 416 document->initContentSecurityPolicy(m_mainScriptLoader->releaseContentSecuri
tyPolicy()); |
415 if (!m_mainScriptLoader->referrerPolicy().isNull()) | 417 if (!m_mainScriptLoader->referrerPolicy().isNull()) |
416 document->parseAndSetReferrerPolicy(m_mainScriptLoader->referrerPolicy()
); | 418 document->parseAndSetReferrerPolicy(m_mainScriptLoader->referrerPolicy()
); |
417 | 419 |
418 KURL scriptURL = m_mainScriptLoader->url(); | 420 KURL scriptURL = m_mainScriptLoader->url(); |
419 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); | 421 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); |
(...skipping 15 matching lines...) Expand all Loading... |
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 |