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 29 matching lines...) Expand all Loading... |
40 #include "WebWorkerPermissionClientProxy.h" | 40 #include "WebWorkerPermissionClientProxy.h" |
41 #include "WorkerPermissionClient.h" | 41 #include "WorkerPermissionClient.h" |
42 #include "core/dom/Document.h" | 42 #include "core/dom/Document.h" |
43 #include "core/loader/FrameLoadRequest.h" | 43 #include "core/loader/FrameLoadRequest.h" |
44 #include "core/loader/SubstituteData.h" | 44 #include "core/loader/SubstituteData.h" |
45 #include "core/workers/WorkerClients.h" | 45 #include "core/workers/WorkerClients.h" |
46 #include "core/workers/WorkerLoaderProxy.h" | 46 #include "core/workers/WorkerLoaderProxy.h" |
47 #include "core/workers/WorkerScriptLoader.h" | 47 #include "core/workers/WorkerScriptLoader.h" |
48 #include "core/workers/WorkerScriptLoaderClient.h" | 48 #include "core/workers/WorkerScriptLoaderClient.h" |
49 #include "core/workers/WorkerThreadStartupData.h" | 49 #include "core/workers/WorkerThreadStartupData.h" |
| 50 #include "heap/Handle.h" |
50 #include "modules/serviceworkers/ServiceWorkerThread.h" | 51 #include "modules/serviceworkers/ServiceWorkerThread.h" |
51 #include "platform/NotImplemented.h" | 52 #include "platform/NotImplemented.h" |
52 #include "platform/SharedBuffer.h" | 53 #include "platform/SharedBuffer.h" |
53 #include "platform/network/ContentSecurityPolicyParsers.h" | 54 #include "platform/network/ContentSecurityPolicyParsers.h" |
54 #include "wtf/Functional.h" | 55 #include "wtf/Functional.h" |
55 | 56 |
56 using namespace WebCore; | 57 using namespace WebCore; |
57 | 58 |
58 namespace blink { | 59 namespace blink { |
59 | 60 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ? PauseWorkerGlobalScopeOnStart : DontPauseWorkerGlobalScopeOnStart; | 231 ? PauseWorkerGlobalScopeOnStart : DontPauseWorkerGlobalScopeOnStart; |
231 | 232 |
232 // This is to be owned by ServiceWorker's WorkerGlobalScope, and is | 233 // This is to be owned by ServiceWorker's WorkerGlobalScope, and is |
233 // guaranteed to be around while the WorkerGlobalScope is alive. | 234 // guaranteed to be around while the WorkerGlobalScope is alive. |
234 WebServiceWorkerContextClient* contextClient = m_workerContextClient.get(); | 235 WebServiceWorkerContextClient* contextClient = m_workerContextClient.get(); |
235 | 236 |
236 OwnPtr<WorkerClients> workerClients = WorkerClients::create(); | 237 OwnPtr<WorkerClients> workerClients = WorkerClients::create(); |
237 providePermissionClientToWorker(workerClients.get(), m_permissionClient.rele
ase()); | 238 providePermissionClientToWorker(workerClients.get(), m_permissionClient.rele
ase()); |
238 provideServiceWorkerGlobalScopeClientToWorker(workerClients.get(), ServiceWo
rkerGlobalScopeClientImpl::create(m_workerContextClient.release())); | 239 provideServiceWorkerGlobalScopeClientToWorker(workerClients.get(), ServiceWo
rkerGlobalScopeClientImpl::create(m_workerContextClient.release())); |
239 | 240 |
240 OwnPtr<WorkerThreadStartupData> startupData = | 241 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = |
241 WorkerThreadStartupData::create( | 242 WorkerThreadStartupData::create( |
242 m_mainScriptLoader->url(), | 243 m_mainScriptLoader->url(), |
243 m_workerStartData.userAgent, | 244 m_workerStartData.userAgent, |
244 m_mainScriptLoader->script(), | 245 m_mainScriptLoader->script(), |
245 startMode, | 246 startMode, |
246 // FIXME: fill appropriate CSP info and policy type. | 247 // FIXME: fill appropriate CSP info and policy type. |
247 String(), | 248 String(), |
248 ContentSecurityPolicyHeaderTypeEnforce, | 249 ContentSecurityPolicyHeaderTypeEnforce, |
249 workerClients.release()); | 250 workerClients.release()); |
250 | 251 |
251 m_mainScriptLoader.clear(); | 252 m_mainScriptLoader.clear(); |
252 | 253 |
253 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW
ebFrameImpl(m_mainFrame)->frame()->document(), *contextClient); | 254 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW
ebFrameImpl(m_mainFrame)->frame()->document(), *contextClient); |
254 m_loaderProxy = LoaderProxy::create(*this); | 255 m_loaderProxy = LoaderProxy::create(*this); |
255 | 256 |
256 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); | 257 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); |
257 m_workerThread->start(); | 258 m_workerThread->start(); |
258 } | 259 } |
259 | 260 |
260 } // namespace blink | 261 } // namespace blink |
OLD | NEW |