| 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; |
| 325 | 328 |
| 326 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) | 329 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) |
| 327 SecurityOrigin* starterOrigin = document->securityOrigin(); | 330 SecurityOrigin* starterOrigin = document->securityOrigin(); |
| 328 | 331 |
| 329 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); | 332 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); |
| 330 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); | 333 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); |
| 331 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); | 334 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); |
| 332 provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client-
>createWorkerContentSettingsClientProxy(webSecurityOrigin))); | 335 provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client-
>createWorkerContentSettingsClientProxy(webSecurityOrigin))); |
| 333 RefPtrWillBeRawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScri
ptLoader->releaseContentSecurityPolicy(); | 336 RefPtrWillBeRawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScri
ptLoader->releaseContentSecurityPolicy(); |
| 334 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do
cument); | |
| 335 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e( | 337 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e( |
| 336 m_url, | 338 m_url, |
| 337 m_loadingDocument->userAgent(), | 339 m_loadingDocument->userAgent(), |
| 338 m_mainScriptLoader->script(), | 340 m_mainScriptLoader->script(), |
| 339 nullptr, | 341 nullptr, |
| 340 startMode, | 342 startMode, |
| 341 contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, | 343 contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, |
| 342 starterOrigin, | 344 starterOrigin, |
| 343 workerClients.release()); | 345 workerClients.release()); |
| 344 m_loaderProxy = WorkerLoaderProxy::create(this); | 346 m_loaderProxy = WorkerLoaderProxy::create(this); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 if (devtoolsAgent) | 393 if (devtoolsAgent) |
| 392 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); | 394 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); |
| 393 } | 395 } |
| 394 | 396 |
| 395 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 397 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
| 396 { | 398 { |
| 397 return new WebSharedWorkerImpl(client); | 399 return new WebSharedWorkerImpl(client); |
| 398 } | 400 } |
| 399 | 401 |
| 400 } // namespace blink | 402 } // namespace blink |
| OLD | NEW |