| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 m_mainScriptLoader->cancel(); | 315 m_mainScriptLoader->cancel(); |
| 316 m_client->workerScriptLoadFailed(); | 316 m_client->workerScriptLoadFailed(); |
| 317 | 317 |
| 318 // The SharedWorker was unable to load the initial script, so | 318 // The SharedWorker was unable to load the initial script, so |
| 319 // shut it down right here. | 319 // shut it down right here. |
| 320 delete this; | 320 delete this; |
| 321 return; | 321 return; |
| 322 } | 322 } |
| 323 | 323 |
| 324 Document* document = m_mainFrame->frame()->document(); | 324 Document* document = m_mainFrame->frame()->document(); |
| 325 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart; | |
| 326 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document)) | |
| 327 startMode = PauseWorkerGlobalScopeOnStart; | |
| 328 | |
| 329 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) | 325 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) |
| 330 SecurityOrigin* starterOrigin = document->securityOrigin(); | 326 SecurityOrigin* starterOrigin = document->securityOrigin(); |
| 331 | 327 |
| 332 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); | 328 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); |
| 333 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); | 329 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); |
| 334 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); | 330 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); |
| 335 provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client-
>createWorkerContentSettingsClientProxy(webSecurityOrigin))); | 331 provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client-
>createWorkerContentSettingsClientProxy(webSecurityOrigin))); |
| 336 RefPtrWillBeRawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScri
ptLoader->releaseContentSecurityPolicy(); | 332 RefPtrWillBeRawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScri
ptLoader->releaseContentSecurityPolicy(); |
| 333 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); |
| 337 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e( | 334 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e( |
| 338 m_url, | 335 m_url, |
| 339 m_loadingDocument->userAgent(), | 336 m_loadingDocument->userAgent(), |
| 340 m_mainScriptLoader->script(), | 337 m_mainScriptLoader->script(), |
| 341 nullptr, | 338 nullptr, |
| 342 startMode, | 339 startMode, |
| 343 contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, | 340 contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, |
| 344 starterOrigin, | 341 starterOrigin, |
| 345 workerClients.release(), | 342 workerClients.release(), |
| 346 m_mainScriptLoader->responseAddressSpace()); | 343 m_mainScriptLoader->responseAddressSpace()); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 if (devtoolsAgent) | 391 if (devtoolsAgent) |
| 395 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); | 392 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); |
| 396 } | 393 } |
| 397 | 394 |
| 398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 395 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
| 399 { | 396 { |
| 400 return new WebSharedWorkerImpl(client); | 397 return new WebSharedWorkerImpl(client); |
| 401 } | 398 } |
| 402 | 399 |
| 403 } // namespace blink | 400 } // namespace blink |
| OLD | NEW |