Chromium Code Reviews| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 { | 395 { |
| 396 ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload); | 396 ASSERT(m_pauseAfterDownloadState == DontPauseAfterDownload); |
| 397 ASSERT(!m_askedToTerminate); | 397 ASSERT(!m_askedToTerminate); |
| 398 | 398 |
| 399 Document* document = toWebLocalFrameImpl(m_mainFrame)->frame()->document(); | 399 Document* document = toWebLocalFrameImpl(m_mainFrame)->frame()->document(); |
| 400 | 400 |
| 401 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart; | 401 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart; |
| 402 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document)) | 402 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document)) |
| 403 startMode = PauseWorkerGlobalScopeOnStart; | 403 startMode = PauseWorkerGlobalScopeOnStart; |
| 404 | 404 |
| 405 SecurityOrigin::PolicyOverrides originPolicyOverrides; | |
| 406 if (document->securityOrigin()) | |
|
horo
2014/09/24 05:42:27
I think WebEmbeddedWorkerImpl's m_mainFrame is not
sof
2014/09/28 17:10:22
Thanks, I missed that -- the document for the shad
| |
| 407 originPolicyOverrides = document->securityOrigin()->policyOverrides(); | |
| 408 | |
| 405 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); | 409 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); |
| 406 providePermissionClientToWorker(workerClients.get(), m_permissionClient.rele ase()); | 410 providePermissionClientToWorker(workerClients.get(), m_permissionClient.rele ase()); |
| 407 provideServiceWorkerGlobalScopeClientToWorker(workerClients.get(), ServiceWo rkerGlobalScopeClientImpl::create(*m_workerContextClient)); | 411 provideServiceWorkerGlobalScopeClientToWorker(workerClients.get(), ServiceWo rkerGlobalScopeClientImpl::create(*m_workerContextClient)); |
| 408 | 412 |
| 409 KURL scriptURL = m_mainScriptLoader->url(); | 413 KURL scriptURL = m_mainScriptLoader->url(); |
| 410 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = | 414 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = |
| 411 WorkerThreadStartupData::create( | 415 WorkerThreadStartupData::create( |
| 412 scriptURL, | 416 scriptURL, |
| 413 m_workerStartData.userAgent, | 417 m_workerStartData.userAgent, |
| 414 m_mainScriptLoader->script(), | 418 m_mainScriptLoader->script(), |
| 415 startMode, | 419 startMode, |
| 416 // FIXME: fill appropriate CSP info and policy type. | 420 // FIXME: fill appropriate CSP info and policy type. |
| 417 String(), | 421 String(), |
| 418 ContentSecurityPolicyHeaderTypeEnforce, | 422 ContentSecurityPolicyHeaderTypeEnforce, |
| 423 originPolicyOverrides, | |
| 419 workerClients.release()); | 424 workerClients.release()); |
| 420 | 425 |
| 421 m_mainScriptLoader.clear(); | 426 m_mainScriptLoader.clear(); |
| 422 | 427 |
| 423 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); | 428 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); |
| 424 m_loaderProxy = LoaderProxy::create(*this); | 429 m_loaderProxy = LoaderProxy::create(*this); |
| 425 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); | 430 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); |
| 426 m_workerThread->start(); | 431 m_workerThread->start(); |
| 427 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); | 432 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); |
| 428 } | 433 } |
| 429 | 434 |
| 430 } // namespace blink | 435 } // namespace blink |
| OLD | NEW |