| 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 29 matching lines...) Expand all Loading... |
| 40 #include "platform/wtf/RefPtr.h" | 40 #include "platform/wtf/RefPtr.h" |
| 41 #include "public/platform/WebAddressSpace.h" | 41 #include "public/platform/WebAddressSpace.h" |
| 42 #include "public/platform/WebContentSecurityPolicy.h" | 42 #include "public/platform/WebContentSecurityPolicy.h" |
| 43 #include "public/web/WebDevToolsAgentClient.h" | 43 #include "public/web/WebDevToolsAgentClient.h" |
| 44 #include "public/web/WebFrameClient.h" | 44 #include "public/web/WebFrameClient.h" |
| 45 #include "public/web/WebSharedWorkerClient.h" | 45 #include "public/web/WebSharedWorkerClient.h" |
| 46 #include "web/WebSharedWorkerReportingProxyImpl.h" | 46 #include "web/WebSharedWorkerReportingProxyImpl.h" |
| 47 | 47 |
| 48 namespace blink { | 48 namespace blink { |
| 49 | 49 |
| 50 class ParentFrameTaskRunners; | |
| 51 class WebApplicationCacheHost; | 50 class WebApplicationCacheHost; |
| 52 class WebApplicationCacheHostClient; | 51 class WebApplicationCacheHostClient; |
| 53 class WebLocalFrameImpl; | 52 class WebLocalFrameImpl; |
| 54 class WebServiceWorkerNetworkProvider; | 53 class WebServiceWorkerNetworkProvider; |
| 55 class WebSharedWorkerClient; | 54 class WebSharedWorkerClient; |
| 56 class WebString; | 55 class WebString; |
| 57 class WebURL; | 56 class WebURL; |
| 58 class WebView; | 57 class WebView; |
| 59 class WorkerInspectorProxy; | 58 class WorkerInspectorProxy; |
| 60 class WorkerScriptLoader; | 59 class WorkerScriptLoader; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // Creates the shadow loader used for worker network requests. | 120 // Creates the shadow loader used for worker network requests. |
| 122 void InitializeLoader(); | 121 void InitializeLoader(); |
| 123 | 122 |
| 124 void LoadShadowPage(); | 123 void LoadShadowPage(); |
| 125 void DidReceiveScriptLoaderResponse(); | 124 void DidReceiveScriptLoaderResponse(); |
| 126 void OnScriptLoaderFinished(); | 125 void OnScriptLoaderFinished(); |
| 127 | 126 |
| 128 void ConnectTaskOnWorkerThread(std::unique_ptr<WebMessagePortChannel>); | 127 void ConnectTaskOnWorkerThread(std::unique_ptr<WebMessagePortChannel>); |
| 129 | 128 |
| 130 // WorkerLoaderProxyProvider | 129 // WorkerLoaderProxyProvider |
| 131 // postTaskToLoader() must be called from a worker thread. | |
| 132 void PostTaskToLoader(const WebTraceLocation&, | |
| 133 std::unique_ptr<WTF::CrossThreadClosure>) override; | |
| 134 void PostTaskToWorkerGlobalScope( | |
| 135 const WebTraceLocation&, | |
| 136 std::unique_ptr<WTF::CrossThreadClosure>) override; | |
| 137 ThreadableLoadingContext* GetThreadableLoadingContext() override; | 130 ThreadableLoadingContext* GetThreadableLoadingContext() override; |
| 138 | 131 |
| 139 // 'shadow page' - created to proxy loading requests from the worker. | 132 // 'shadow page' - created to proxy loading requests from the worker. |
| 140 // Will be accessed by worker thread when posting tasks. | 133 // Will be accessed by worker thread when posting tasks. |
| 141 Persistent<ExecutionContext> loading_document_; | 134 Persistent<ExecutionContext> loading_document_; |
| 142 Persistent<ThreadableLoadingContext> loading_context_; | 135 Persistent<ThreadableLoadingContext> loading_context_; |
| 143 WebView* web_view_; | 136 WebView* web_view_; |
| 144 Persistent<WebLocalFrameImpl> main_frame_; | 137 Persistent<WebLocalFrameImpl> main_frame_; |
| 145 bool asked_to_terminate_; | 138 bool asked_to_terminate_; |
| 146 | 139 |
| 147 std::unique_ptr<WebServiceWorkerNetworkProvider> network_provider_; | 140 std::unique_ptr<WebServiceWorkerNetworkProvider> network_provider_; |
| 148 | 141 |
| 149 Persistent<WorkerInspectorProxy> worker_inspector_proxy_; | 142 Persistent<WorkerInspectorProxy> worker_inspector_proxy_; |
| 150 | 143 |
| 151 // Owned by the main thread, but will be accessed by the worker. | |
| 152 CrossThreadPersistent<ParentFrameTaskRunners> parent_frame_task_runners_; | |
| 153 | |
| 154 Persistent<WebSharedWorkerReportingProxyImpl> reporting_proxy_; | 144 Persistent<WebSharedWorkerReportingProxyImpl> reporting_proxy_; |
| 155 std::unique_ptr<WorkerThread> worker_thread_; | 145 std::unique_ptr<WorkerThread> worker_thread_; |
| 156 | 146 |
| 157 WebSharedWorkerClient* client_; | 147 WebSharedWorkerClient* client_; |
| 158 | 148 |
| 159 bool pause_worker_context_on_start_; | 149 bool pause_worker_context_on_start_; |
| 160 bool is_paused_on_start_; | 150 bool is_paused_on_start_; |
| 161 | 151 |
| 162 // Kept around only while main script loading is ongoing. | 152 // Kept around only while main script loading is ongoing. |
| 163 RefPtr<WorkerScriptLoader> main_script_loader_; | 153 RefPtr<WorkerScriptLoader> main_script_loader_; |
| 164 | 154 |
| 165 RefPtr<WorkerLoaderProxy> loader_proxy_; | 155 RefPtr<WorkerLoaderProxy> loader_proxy_; |
| 166 | 156 |
| 167 WebURL url_; | 157 WebURL url_; |
| 168 WebString name_; | 158 WebString name_; |
| 169 WebAddressSpace creation_address_space_; | 159 WebAddressSpace creation_address_space_; |
| 170 }; | 160 }; |
| 171 | 161 |
| 172 } // namespace blink | 162 } // namespace blink |
| 173 | 163 |
| 174 #endif // WebSharedWorkerImpl_h | 164 #endif // WebSharedWorkerImpl_h |
| OLD | NEW |