OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) | 330 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) |
331 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); | 331 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); |
332 | 332 |
333 WorkerClients* workerClients = WorkerClients::create(); | 333 WorkerClients* workerClients = WorkerClients::create(); |
334 provideLocalFileSystemToWorker(workerClients, LocalFileSystemClient::create(
)); | 334 provideLocalFileSystemToWorker(workerClients, LocalFileSystemClient::create(
)); |
335 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->getSecurityOrigin()); | 335 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->getSecurityOrigin()); |
336 provideContentSettingsClientToWorker(workerClients, wrapUnique(m_client->cre
ateWorkerContentSettingsClientProxy(webSecurityOrigin))); | 336 provideContentSettingsClientToWorker(workerClients, wrapUnique(m_client->cre
ateWorkerContentSettingsClientProxy(webSecurityOrigin))); |
337 provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create())
; | 337 provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create())
; |
338 ContentSecurityPolicy* contentSecurityPolicy = m_mainScriptLoader->releaseCo
ntentSecurityPolicy(); | 338 ContentSecurityPolicy* contentSecurityPolicy = m_mainScriptLoader->releaseCo
ntentSecurityPolicy(); |
339 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); | 339 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); |
| 340 std::unique_ptr<WorkerSettings> workerSettings = wrapUnique(new WorkerSettin
gs(document->settings())); |
340 std::unique_ptr<WorkerThreadStartupData> startupData = WorkerThreadStartupDa
ta::create( | 341 std::unique_ptr<WorkerThreadStartupData> startupData = WorkerThreadStartupDa
ta::create( |
341 m_url, | 342 m_url, |
342 m_loadingDocument->userAgent(), | 343 m_loadingDocument->userAgent(), |
343 m_mainScriptLoader->script(), | 344 m_mainScriptLoader->script(), |
344 nullptr, | 345 nullptr, |
345 startMode, | 346 startMode, |
346 contentSecurityPolicy ? contentSecurityPolicy->headers().get() : nullptr
, | 347 contentSecurityPolicy ? contentSecurityPolicy->headers().get() : nullptr
, |
347 m_mainScriptLoader->referrerPolicy(), | 348 m_mainScriptLoader->referrerPolicy(), |
348 starterOrigin, | 349 starterOrigin, |
349 workerClients, | 350 workerClients, |
350 m_mainScriptLoader->responseAddressSpace(), | 351 m_mainScriptLoader->responseAddressSpace(), |
351 m_mainScriptLoader->originTrialTokens()); | 352 m_mainScriptLoader->originTrialTokens(), |
| 353 std::move(workerSettings)); |
352 m_loaderProxy = WorkerLoaderProxy::create(this); | 354 m_loaderProxy = WorkerLoaderProxy::create(this); |
353 m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this); | 355 m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this); |
354 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri
ptLoader->identifier(), m_mainScriptLoader->script()); | 356 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri
ptLoader->identifier(), m_mainScriptLoader->script()); |
355 m_mainScriptLoader.clear(); | 357 m_mainScriptLoader.clear(); |
356 | 358 |
357 workerThread()->start(std::move(startupData)); | 359 workerThread()->start(std::move(startupData)); |
358 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument.get
()), workerThread(), m_url); | 360 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument.get
()), workerThread(), m_url); |
359 m_client->workerScriptLoaded(); | 361 m_client->workerScriptLoaded(); |
360 } | 362 } |
361 | 363 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if (devtoolsAgent) | 401 if (devtoolsAgent) |
400 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, mes
sage); | 402 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, mes
sage); |
401 } | 403 } |
402 | 404 |
403 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 405 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
404 { | 406 { |
405 return new WebSharedWorkerImpl(client); | 407 return new WebSharedWorkerImpl(client); |
406 } | 408 } |
407 | 409 |
408 } // namespace blink | 410 } // namespace blink |
OLD | NEW |