OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_GLUE_WEBWORKER_IMPL_H_ | 5 #ifndef WEBKIT_GLUE_WEBWORKER_IMPL_H_ |
6 #define WEBKIT_GLUE_WEBWORKER_IMPL_H_ | 6 #define WEBKIT_GLUE_WEBWORKER_IMPL_H_ |
7 | 7 |
8 #include "webkit/api/public/WebWorker.h" | 8 #include "webkit/api/public/WebWorker.h" |
9 | 9 |
10 #if ENABLE(WORKERS) | 10 #if ENABLE(WORKERS) |
11 | 11 |
12 #include "ScriptExecutionContext.h" | 12 #include "ScriptExecutionContext.h" |
13 #include "WorkerLoaderProxy.h" | 13 #include "WorkerLoaderProxy.h" |
14 #include "WorkerObjectProxy.h" | 14 #include "WorkerObjectProxy.h" |
15 #include <wtf/RefPtr.h> | 15 #include <wtf/RefPtr.h> |
16 | 16 |
17 namespace WebCore { | 17 namespace WebCore { |
18 class Strng; | 18 class Strng; |
19 class WorkerThread; | 19 class WorkerThread; |
20 }; | 20 }; |
21 | 21 |
| 22 class WebView; |
| 23 |
22 // This class is used by the worker process code to talk to the WebCore::Worker | 24 // This class is used by the worker process code to talk to the WebCore::Worker |
23 // implementation. It can't use it directly since it uses WebKit types, so this | 25 // implementation. It can't use it directly since it uses WebKit types, so this |
24 // class converts the data types. When the WebCore::Worker object wants to call | 26 // class converts the data types. When the WebCore::Worker object wants to call |
25 // WebCore::WorkerObjectProxy, this class will conver to Chrome data types first | 27 // WebCore::WorkerObjectProxy, this class will conver to Chrome data types first |
26 // and then call the supplied WebWorkerClient. | 28 // and then call the supplied WebWorkerClient. |
27 class WebWorkerImpl: public WebCore::WorkerObjectProxy, | 29 class WebWorkerImpl: public WebCore::WorkerObjectProxy, |
28 public WebCore::WorkerLoaderProxy, | 30 public WebCore::WorkerLoaderProxy, |
29 public WebKit::WebWorker { | 31 public WebKit::WebWorker { |
30 public: | 32 public: |
31 explicit WebWorkerImpl(WebKit::WebWorkerClient* client); | 33 explicit WebWorkerImpl(WebKit::WebWorkerClient* client); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 bool has_pending_activity); | 108 bool has_pending_activity); |
107 static void ReportPendingActivityTask( | 109 static void ReportPendingActivityTask( |
108 WebCore::ScriptExecutionContext* context, | 110 WebCore::ScriptExecutionContext* context, |
109 WebWorkerImpl* this_ptr, | 111 WebWorkerImpl* this_ptr, |
110 bool has_pending_activity); | 112 bool has_pending_activity); |
111 static void WorkerContextDestroyedTask( | 113 static void WorkerContextDestroyedTask( |
112 WebCore::ScriptExecutionContext* context, | 114 WebCore::ScriptExecutionContext* context, |
113 WebWorkerImpl* this_ptr); | 115 WebWorkerImpl* this_ptr); |
114 | 116 |
115 WebKit::WebWorkerClient* client_; | 117 WebKit::WebWorkerClient* client_; |
| 118 |
| 119 // 'shadow page' - created to proxy loading requests from the worker. |
| 120 WTF::RefPtr<WebCore::ScriptExecutionContext> loading_document_; |
| 121 WebView* web_view_; |
| 122 |
116 WTF::RefPtr<WebCore::WorkerThread> worker_thread_; | 123 WTF::RefPtr<WebCore::WorkerThread> worker_thread_; |
117 | 124 |
118 DISALLOW_COPY_AND_ASSIGN(WebWorkerImpl); | 125 DISALLOW_COPY_AND_ASSIGN(WebWorkerImpl); |
119 }; | 126 }; |
120 | 127 |
121 #endif | 128 #endif |
122 | 129 |
123 #endif // WEBKIT_GLUE_WEBWORKER_IMPL_H_ | 130 #endif // WEBKIT_GLUE_WEBWORKER_IMPL_H_ |
OLD | NEW |