| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "core/inspector/WorkerInspectorController.h" | 49 #include "core/inspector/WorkerInspectorController.h" |
| 50 #include "core/loader/FrameLoadRequest.h" | 50 #include "core/loader/FrameLoadRequest.h" |
| 51 #include "core/loader/FrameLoader.h" | 51 #include "core/loader/FrameLoader.h" |
| 52 #include "core/page/Page.h" | 52 #include "core/page/Page.h" |
| 53 #include "core/workers/SharedWorkerGlobalScope.h" | 53 #include "core/workers/SharedWorkerGlobalScope.h" |
| 54 #include "core/workers/SharedWorkerThread.h" | 54 #include "core/workers/SharedWorkerThread.h" |
| 55 #include "core/workers/WorkerClients.h" | 55 #include "core/workers/WorkerClients.h" |
| 56 #include "core/workers/WorkerGlobalScope.h" | 56 #include "core/workers/WorkerGlobalScope.h" |
| 57 #include "core/workers/WorkerScriptLoader.h" | 57 #include "core/workers/WorkerScriptLoader.h" |
| 58 #include "core/workers/WorkerThreadStartupData.h" | 58 #include "core/workers/WorkerThreadStartupData.h" |
| 59 #include "heap/Handle.h" |
| 59 #include "modules/webdatabase/DatabaseTask.h" | 60 #include "modules/webdatabase/DatabaseTask.h" |
| 60 #include "platform/network/ContentSecurityPolicyParsers.h" | 61 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 61 #include "platform/network/ResourceResponse.h" | 62 #include "platform/network/ResourceResponse.h" |
| 62 #include "platform/weborigin/KURL.h" | 63 #include "platform/weborigin/KURL.h" |
| 63 #include "platform/weborigin/SecurityOrigin.h" | 64 #include "platform/weborigin/SecurityOrigin.h" |
| 64 #include "public/platform/WebFileError.h" | 65 #include "public/platform/WebFileError.h" |
| 65 #include "public/platform/WebMessagePortChannel.h" | 66 #include "public/platform/WebMessagePortChannel.h" |
| 66 #include "public/platform/WebString.h" | 67 #include "public/platform/WebString.h" |
| 67 #include "public/platform/WebURL.h" | 68 #include "public/platform/WebURL.h" |
| 68 #include "public/web/WebWorkerPermissionClientProxy.h" | 69 #include "public/web/WebWorkerPermissionClientProxy.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 if (client()) | 344 if (client()) |
| 344 client()->workerScriptLoadFailed(); | 345 client()->workerScriptLoadFailed(); |
| 345 return; | 346 return; |
| 346 } | 347 } |
| 347 WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerG
lobalScopeOnStart : DontPauseWorkerGlobalScopeOnStart; | 348 WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerG
lobalScopeOnStart : DontPauseWorkerGlobalScopeOnStart; |
| 348 OwnPtr<WorkerClients> workerClients = WorkerClients::create(); | 349 OwnPtr<WorkerClients> workerClients = WorkerClients::create(); |
| 349 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); | 350 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); |
| 350 provideDatabaseClientToWorker(workerClients.get(), DatabaseClientImpl::creat
e()); | 351 provideDatabaseClientToWorker(workerClients.get(), DatabaseClientImpl::creat
e()); |
| 351 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); | 352 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); |
| 352 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea
teWorkerPermissionClientProxy(webSecurityOrigin))); | 353 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea
teWorkerPermissionClientProxy(webSecurityOrigin))); |
| 353 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->script(), star
tMode, m_contentSecurityPolicy, static_cast<WebCore::ContentSecurityPolicyHeader
Type>(m_policyType), workerClients.release()); | 354 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu
pData::create(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->sc
ript(), startMode, m_contentSecurityPolicy, static_cast<WebCore::ContentSecurity
PolicyHeaderType>(m_policyType), workerClients.release()); |
| 354 setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, startupData
.release())); | 355 setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, startupData
.release())); |
| 355 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri
ptLoader->identifier(), m_mainScriptLoader->script()); | 356 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri
ptLoader->identifier(), m_mainScriptLoader->script()); |
| 356 m_mainScriptLoader.clear(); | 357 m_mainScriptLoader.clear(); |
| 357 | 358 |
| 358 if (m_attachDevToolsOnStart) | 359 if (m_attachDevToolsOnStart) |
| 359 workerThread()->runLoop().postDebuggerTask(createCallbackTask(connectToW
orkerContextInspectorTask, true)); | 360 workerThread()->runLoop().postDebuggerTask(createCallbackTask(connectToW
orkerContextInspectorTask, true)); |
| 360 | 361 |
| 361 workerThread()->start(); | 362 workerThread()->start(); |
| 362 if (client()) | 363 if (client()) |
| 363 client()->workerScriptLoaded(); | 364 client()->workerScriptLoaded(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 workerThread()->runLoop().postDebuggerTask(createCallbackTask(dispatchOnInsp
ectorBackendTask, String(message))); | 432 workerThread()->runLoop().postDebuggerTask(createCallbackTask(dispatchOnInsp
ectorBackendTask, String(message))); |
| 432 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); | 433 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); |
| 433 } | 434 } |
| 434 | 435 |
| 435 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 436 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
| 436 { | 437 { |
| 437 return new WebSharedWorkerImpl(client); | 438 return new WebSharedWorkerImpl(client); |
| 438 } | 439 } |
| 439 | 440 |
| 440 } // namespace blink | 441 } // namespace blink |
| OLD | NEW |