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 // FIXME: this document's origin is pristine and without any extra privilege s. | |
|
Mike West
2014/09/29 07:37:22
Can you point to a bug here? I don't understand th
sof
2014/09/29 09:42:28
Added crbug.com xref.
| |
| 406 SecurityOrigin* starterOrigin = document->securityOrigin(); | |
| 407 | |
| 405 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); | 408 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); |
| 406 providePermissionClientToWorker(workerClients.get(), m_permissionClient.rele ase()); | 409 providePermissionClientToWorker(workerClients.get(), m_permissionClient.rele ase()); |
| 407 provideServiceWorkerGlobalScopeClientToWorker(workerClients.get(), ServiceWo rkerGlobalScopeClientImpl::create(*m_workerContextClient)); | 410 provideServiceWorkerGlobalScopeClientToWorker(workerClients.get(), ServiceWo rkerGlobalScopeClientImpl::create(*m_workerContextClient)); |
| 408 | 411 |
| 409 KURL scriptURL = m_mainScriptLoader->url(); | 412 KURL scriptURL = m_mainScriptLoader->url(); |
| 410 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = | 413 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = |
| 411 WorkerThreadStartupData::create( | 414 WorkerThreadStartupData::create( |
| 412 scriptURL, | 415 scriptURL, |
| 413 m_workerStartData.userAgent, | 416 m_workerStartData.userAgent, |
| 414 m_mainScriptLoader->script(), | 417 m_mainScriptLoader->script(), |
| 415 startMode, | 418 startMode, |
| 416 // FIXME: fill appropriate CSP info and policy type. | 419 // FIXME: fill appropriate CSP info and policy type. |
| 417 String(), | 420 String(), |
| 418 ContentSecurityPolicyHeaderTypeEnforce, | 421 ContentSecurityPolicyHeaderTypeEnforce, |
| 422 starterOrigin, | |
| 419 workerClients.release()); | 423 workerClients.release()); |
| 420 | 424 |
| 421 m_mainScriptLoader.clear(); | 425 m_mainScriptLoader.clear(); |
| 422 | 426 |
| 423 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); | 427 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc ument, *m_workerContextClient); |
| 424 m_loaderProxy = LoaderProxy::create(*this); | 428 m_loaderProxy = LoaderProxy::create(*this); |
| 425 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); | 429 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal ScopeProxy, startupData.release()); |
| 426 m_workerThread->start(); | 430 m_workerThread->start(); |
| 427 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); | 431 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(), scriptURL); |
| 428 } | 432 } |
| 429 | 433 |
| 430 } // namespace blink | 434 } // namespace blink |
| OLD | NEW |