OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ | 5 #ifndef CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ |
6 #define CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ | 6 #define CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/task.h" | 10 #include "base/task.h" |
11 #include "ipc/ipc_channel.h" | 11 #include "ipc/ipc_channel.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystem.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWorkerClient.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWorkerClient.h" |
14 | 14 |
| 15 #ifndef WebTransferableReceipt_h |
| 16 #ifndef STUB_WebTransferableReceipt_h |
| 17 #define STUB_WebTransferableReceipt_h |
| 18 namespace WebKit { |
| 19 typedef WebMessagePortChannel WebTransferableReceipt; |
| 20 typedef WebVector<WebTransferableReceipt*> WebTransferableReceiptArray; |
| 21 } // namespace WebKit |
| 22 #endif // STUB_WebTransferableReceipt_h |
| 23 #endif // WebTransferableReceipt_h |
| 24 |
15 namespace WebKit { | 25 namespace WebKit { |
16 class WebApplicationCacheHost; | 26 class WebApplicationCacheHost; |
17 class WebApplicationCacheHostClient; | 27 class WebApplicationCacheHostClient; |
18 class WebFrame; | 28 class WebFrame; |
19 class WebWorker; | 29 class WebWorker; |
20 } | 30 } |
21 | 31 |
22 class WebWorkerStubBase; | 32 class WebWorkerStubBase; |
23 class WorkerDevToolsAgent; | 33 class WorkerDevToolsAgent; |
24 | 34 |
25 // This class receives IPCs from the renderer and calls the WebCore::Worker | 35 // This class receives IPCs from the renderer and calls the WebCore::Worker |
26 // implementation (after the data types have been converted by glue code). It | 36 // implementation (after the data types have been converted by glue code). It |
27 // is also called by the worker code and converts these function calls into | 37 // is also called by the worker code and converts these function calls into |
28 // IPCs that are sent to the renderer, where they're converted back to function | 38 // IPCs that are sent to the renderer, where they're converted back to function |
29 // calls by WebWorkerProxy. | 39 // calls by WebWorkerProxy. |
30 class WebWorkerClientProxy : public WebKit::WebWorkerClient { | 40 class WebWorkerClientProxy : public WebKit::WebWorkerClient { |
31 public: | 41 public: |
32 WebWorkerClientProxy(int route_id, WebWorkerStubBase* stub); | 42 WebWorkerClientProxy(int route_id, WebWorkerStubBase* stub); |
33 virtual ~WebWorkerClientProxy(); | 43 virtual ~WebWorkerClientProxy(); |
34 | 44 |
35 // WebWorkerClient implementation. | 45 // WebWorkerClient implementation. |
36 virtual void postMessageToWorkerObject( | 46 virtual void postMessageToWorkerObject( |
37 const WebKit::WebString& message, | 47 const WebKit::WebString& message, |
38 const WebKit::WebMessagePortChannelArray& channel); | 48 const WebKit::WebTransferableReceiptArray& receipts); |
39 virtual void postExceptionToWorkerObject( | 49 virtual void postExceptionToWorkerObject( |
40 const WebKit::WebString& error_message, | 50 const WebKit::WebString& error_message, |
41 int line_number, | 51 int line_number, |
42 const WebKit::WebString& source_url); | 52 const WebKit::WebString& source_url); |
43 // TODO(caseq): The overload before is obsolete and is preserved for | 53 // TODO(caseq): The overload before is obsolete and is preserved for |
44 // WebKit/chromium compatibility only (pure virtual is base class). | 54 // WebKit/chromium compatibility only (pure virtual is base class). |
45 // Should be removed once WebKit part is updated. | 55 // Should be removed once WebKit part is updated. |
46 virtual void postConsoleMessageToWorkerObject( | 56 virtual void postConsoleMessageToWorkerObject( |
47 int destination, | 57 int destination, |
48 int source, | 58 int source, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 int route_id_; | 103 int route_id_; |
94 int appcache_host_id_; | 104 int appcache_host_id_; |
95 WebWorkerStubBase* stub_; | 105 WebWorkerStubBase* stub_; |
96 ScopedRunnableMethodFactory<WebWorkerClientProxy> kill_process_factory_; | 106 ScopedRunnableMethodFactory<WebWorkerClientProxy> kill_process_factory_; |
97 WorkerDevToolsAgent* devtools_agent_; | 107 WorkerDevToolsAgent* devtools_agent_; |
98 | 108 |
99 DISALLOW_COPY_AND_ASSIGN(WebWorkerClientProxy); | 109 DISALLOW_COPY_AND_ASSIGN(WebWorkerClientProxy); |
100 }; | 110 }; |
101 | 111 |
102 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ | 112 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ |
OLD | NEW |