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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "core/loader/FrameLoadRequest.h" | 42 #include "core/loader/FrameLoadRequest.h" |
43 #include "core/loader/FrameLoader.h" | 43 #include "core/loader/FrameLoader.h" |
44 #include "core/page/Page.h" | 44 #include "core/page/Page.h" |
45 #include "core/workers/SharedWorkerGlobalScope.h" | 45 #include "core/workers/SharedWorkerGlobalScope.h" |
46 #include "core/workers/SharedWorkerThread.h" | 46 #include "core/workers/SharedWorkerThread.h" |
47 #include "core/workers/WorkerClients.h" | 47 #include "core/workers/WorkerClients.h" |
48 #include "core/workers/WorkerGlobalScope.h" | 48 #include "core/workers/WorkerGlobalScope.h" |
49 #include "core/workers/WorkerInspectorProxy.h" | 49 #include "core/workers/WorkerInspectorProxy.h" |
50 #include "core/workers/WorkerScriptLoader.h" | 50 #include "core/workers/WorkerScriptLoader.h" |
51 #include "core/workers/WorkerThreadStartupData.h" | 51 #include "core/workers/WorkerThreadStartupData.h" |
52 #include "modules/webdatabase/DatabaseTask.h" | |
53 #include "platform/RuntimeEnabledFeatures.h" | 52 #include "platform/RuntimeEnabledFeatures.h" |
54 #include "platform/heap/Handle.h" | 53 #include "platform/heap/Handle.h" |
55 #include "platform/network/ContentSecurityPolicyParsers.h" | 54 #include "platform/network/ContentSecurityPolicyParsers.h" |
56 #include "platform/network/ResourceResponse.h" | 55 #include "platform/network/ResourceResponse.h" |
57 #include "platform/weborigin/KURL.h" | 56 #include "platform/weborigin/KURL.h" |
58 #include "platform/weborigin/SecurityOrigin.h" | 57 #include "platform/weborigin/SecurityOrigin.h" |
59 #include "public/platform/WebFileError.h" | 58 #include "public/platform/WebFileError.h" |
60 #include "public/platform/WebMessagePortChannel.h" | 59 #include "public/platform/WebMessagePortChannel.h" |
61 #include "public/platform/WebString.h" | 60 #include "public/platform/WebString.h" |
62 #include "public/platform/WebURL.h" | 61 #include "public/platform/WebURL.h" |
63 #include "public/platform/WebURLRequest.h" | 62 #include "public/platform/WebURLRequest.h" |
64 #include "public/web/WebDevToolsAgent.h" | 63 #include "public/web/WebDevToolsAgent.h" |
65 #include "public/web/WebFrame.h" | 64 #include "public/web/WebFrame.h" |
66 #include "public/web/WebSettings.h" | 65 #include "public/web/WebSettings.h" |
67 #include "public/web/WebView.h" | 66 #include "public/web/WebView.h" |
68 #include "public/web/WebWorkerPermissionClientProxy.h" | 67 #include "public/web/WebWorkerPermissionClientProxy.h" |
69 #include "web/DatabaseClientImpl.h" | |
70 #include "web/LocalFileSystemClient.h" | 68 #include "web/LocalFileSystemClient.h" |
71 #include "web/WebDataSourceImpl.h" | 69 #include "web/WebDataSourceImpl.h" |
72 #include "web/WebLocalFrameImpl.h" | 70 #include "web/WebLocalFrameImpl.h" |
73 #include "web/WorkerPermissionClient.h" | 71 #include "web/WorkerPermissionClient.h" |
74 #include "wtf/Functional.h" | 72 #include "wtf/Functional.h" |
75 #include "wtf/MainThread.h" | 73 #include "wtf/MainThread.h" |
76 | 74 |
77 namespace blink { | 75 namespace blink { |
78 | 76 |
79 // A thin wrapper for one-off script loading. | 77 // A thin wrapper for one-off script loading. |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 return; | 389 return; |
392 } | 390 } |
393 | 391 |
394 Document* document = toWebLocalFrameImpl(m_mainFrame)->frame()->document(); | 392 Document* document = toWebLocalFrameImpl(m_mainFrame)->frame()->document(); |
395 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart; | 393 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart; |
396 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document)) | 394 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document)) |
397 startMode = PauseWorkerGlobalScopeOnStart; | 395 startMode = PauseWorkerGlobalScopeOnStart; |
398 | 396 |
399 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); | 397 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); |
400 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); | 398 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); |
401 provideDatabaseClientToWorker(workerClients.get(), DatabaseClientImpl::creat
e()); | |
402 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); | 399 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); |
403 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea
teWorkerPermissionClientProxy(webSecurityOrigin))); | 400 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea
teWorkerPermissionClientProxy(webSecurityOrigin))); |
404 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu
pData::create(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->sc
ript(), startMode, m_contentSecurityPolicy, static_cast<ContentSecurityPolicyHea
derType>(m_policyType), workerClients.release()); | 401 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu
pData::create(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->sc
ript(), startMode, m_contentSecurityPolicy, static_cast<ContentSecurityPolicyHea
derType>(m_policyType), workerClients.release()); |
405 setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, startupData
.release())); | 402 setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, startupData
.release())); |
406 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri
ptLoader->identifier(), m_mainScriptLoader->script()); | 403 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri
ptLoader->identifier(), m_mainScriptLoader->script()); |
407 m_mainScriptLoader.clear(); | 404 m_mainScriptLoader.clear(); |
408 | 405 |
409 workerThread()->start(); | 406 workerThread()->start(); |
410 m_workerInspectorProxy->workerThreadCreated(m_loadingDocument.get(), workerT
hread(), m_url); | 407 m_workerInspectorProxy->workerThreadCreated(m_loadingDocument.get(), workerT
hread(), m_url); |
411 if (client()) | 408 if (client()) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 if (devtoolsAgent) | 457 if (devtoolsAgent) |
461 devtoolsAgent->dispatchOnInspectorBackend(message); | 458 devtoolsAgent->dispatchOnInspectorBackend(message); |
462 } | 459 } |
463 | 460 |
464 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 461 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
465 { | 462 { |
466 return new WebSharedWorkerImpl(client); | 463 return new WebSharedWorkerImpl(client); |
467 } | 464 } |
468 | 465 |
469 } // namespace blink | 466 } // namespace blink |
OLD | NEW |