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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 loadShadowPage(); | 210 loadShadowPage(); |
211 } | 211 } |
212 | 212 |
213 // WorkerReportingProxy -------------------------------------------------------- | 213 // WorkerReportingProxy -------------------------------------------------------- |
214 | 214 |
215 void WebSharedWorkerImpl::reportException(const String& errorMessage, int lineNu
mber, int columnNumber, const String& sourceURL, int exceptionId) | 215 void WebSharedWorkerImpl::reportException(const String& errorMessage, int lineNu
mber, int columnNumber, const String& sourceURL, int exceptionId) |
216 { | 216 { |
217 // Not suppported in SharedWorker. | 217 // Not suppported in SharedWorker. |
218 } | 218 } |
219 | 219 |
220 void WebSharedWorkerImpl::reportConsoleMessage(RawPtr<ConsoleMessage>) | 220 void WebSharedWorkerImpl::reportConsoleMessage(ConsoleMessage*) |
221 { | 221 { |
222 // Not supported in SharedWorker. | 222 // Not supported in SharedWorker. |
223 } | 223 } |
224 | 224 |
225 void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) | 225 void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) |
226 { | 226 { |
227 m_mainFrame->frame()->document()->postInspectorTask(BLINK_FROM_HERE, createC
rossThreadTask(&WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread, thi
s, message)); | 227 m_mainFrame->frame()->document()->postInspectorTask(BLINK_FROM_HERE, createC
rossThreadTask(&WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread, thi
s, message)); |
228 } | 228 } |
229 | 229 |
230 void WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread(const String& m
essage) | 230 void WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread(const String& m
essage) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 // The SharedWorker was unable to load the initial script, so | 316 // The SharedWorker was unable to load the initial script, so |
317 // shut it down right here. | 317 // shut it down right here. |
318 delete this; | 318 delete this; |
319 return; | 319 return; |
320 } | 320 } |
321 | 321 |
322 Document* document = m_mainFrame->frame()->document(); | 322 Document* document = m_mainFrame->frame()->document(); |
323 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) | 323 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) |
324 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); | 324 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); |
325 | 325 |
326 RawPtr<WorkerClients> workerClients = WorkerClients::create(); | 326 WorkerClients* workerClients = WorkerClients::create(); |
327 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); | 327 provideLocalFileSystemToWorker(workerClients, LocalFileSystemClient::create(
)); |
328 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->getSecurityOrigin()); | 328 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->getSecurityOrigin()); |
329 provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client-
>createWorkerContentSettingsClientProxy(webSecurityOrigin))); | 329 provideContentSettingsClientToWorker(workerClients, adoptPtr(m_client->creat
eWorkerContentSettingsClientProxy(webSecurityOrigin))); |
330 RawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScriptLoader->re
leaseContentSecurityPolicy(); | 330 ContentSecurityPolicy* contentSecurityPolicy = m_mainScriptLoader->releaseCo
ntentSecurityPolicy(); |
331 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); | 331 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); |
332 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e( | 332 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e( |
333 m_url, | 333 m_url, |
334 m_loadingDocument->userAgent(), | 334 m_loadingDocument->userAgent(), |
335 m_mainScriptLoader->script(), | 335 m_mainScriptLoader->script(), |
336 nullptr, | 336 nullptr, |
337 startMode, | 337 startMode, |
338 contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, | 338 contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, |
339 starterOrigin, | 339 starterOrigin, |
340 workerClients.release(), | 340 workerClients, |
341 m_mainScriptLoader->responseAddressSpace()); | 341 m_mainScriptLoader->responseAddressSpace()); |
342 m_loaderProxy = WorkerLoaderProxy::create(this); | 342 m_loaderProxy = WorkerLoaderProxy::create(this); |
343 m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this); | 343 m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this); |
344 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri
ptLoader->identifier(), m_mainScriptLoader->script()); | 344 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri
ptLoader->identifier(), m_mainScriptLoader->script()); |
345 m_mainScriptLoader.clear(); | 345 m_mainScriptLoader.clear(); |
346 | 346 |
347 workerThread()->start(startupData.release()); | 347 workerThread()->start(startupData.release()); |
348 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument.get
()), workerThread(), m_url); | 348 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument.get
()), workerThread(), m_url); |
349 m_client->workerScriptLoaded(); | 349 m_client->workerScriptLoaded(); |
350 } | 350 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 if (devtoolsAgent) | 389 if (devtoolsAgent) |
390 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); | 390 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); |
391 } | 391 } |
392 | 392 |
393 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 393 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
394 { | 394 { |
395 return new WebSharedWorkerImpl(client); | 395 return new WebSharedWorkerImpl(client); |
396 } | 396 } |
397 | 397 |
398 } // namespace blink | 398 } // namespace blink |
OLD | NEW |