| 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 namespace WebKit { | 15 namespace WebKit { |
| 16 class WebApplicationCacheHost; | 16 class WebApplicationCacheHost; |
| 17 class WebApplicationCacheHostClient; | 17 class WebApplicationCacheHostClient; |
| 18 class WebFrame; | 18 class WebFrame; |
| 19 class WebWorker; | 19 class WebWorker; |
| 20 } | 20 } |
| 21 | 21 |
| 22 class SharedWorkerDevToolsAgent; | 22 class SharedWorkerDevToolsAgent; |
| 23 class WebWorkerStubBase; | 23 class WebSharedWorkerStub; |
| 24 | 24 |
| 25 // This class receives IPCs from the renderer and calls the WebCore::Worker | 25 // 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 | 26 // 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 | 27 // 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 | 28 // IPCs that are sent to the renderer, where they're converted back to function |
| 29 // calls by WebWorkerProxy. | 29 // calls by WebWorkerProxy. |
| 30 class WebWorkerClientProxy : public WebKit::WebWorkerClient { | 30 class WebWorkerClientProxy : public WebKit::WebWorkerClient { |
| 31 public: | 31 public: |
| 32 WebWorkerClientProxy(int route_id, WebWorkerStubBase* stub); | 32 WebWorkerClientProxy(int route_id, WebSharedWorkerStub* stub); |
| 33 virtual ~WebWorkerClientProxy(); | 33 virtual ~WebWorkerClientProxy(); |
| 34 | 34 |
| 35 // WebWorkerClient implementation. | 35 // WebWorkerClient implementation. |
| 36 virtual void postMessageToWorkerObject( | 36 virtual void postMessageToWorkerObject( |
| 37 const WebKit::WebString& message, | 37 const WebKit::WebString& message, |
| 38 const WebKit::WebMessagePortChannelArray& channel); | 38 const WebKit::WebMessagePortChannelArray& channel); |
| 39 virtual void postExceptionToWorkerObject( | 39 virtual void postExceptionToWorkerObject( |
| 40 const WebKit::WebString& error_message, | 40 const WebKit::WebString& error_message, |
| 41 int line_number, | 41 int line_number, |
| 42 const WebKit::WebString& source_url); | 42 const WebKit::WebString& source_url); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) { | 87 void set_devtools_agent(SharedWorkerDevToolsAgent* devtools_agent) { |
| 88 devtools_agent_ = devtools_agent; | 88 devtools_agent_ = devtools_agent; |
| 89 } | 89 } |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 bool Send(IPC::Message* message); | 92 bool Send(IPC::Message* message); |
| 93 | 93 |
| 94 int route_id_; | 94 int route_id_; |
| 95 int appcache_host_id_; | 95 int appcache_host_id_; |
| 96 WebWorkerStubBase* stub_; | 96 WebSharedWorkerStub* stub_; |
| 97 ScopedRunnableMethodFactory<WebWorkerClientProxy> kill_process_factory_; | 97 ScopedRunnableMethodFactory<WebWorkerClientProxy> kill_process_factory_; |
| 98 SharedWorkerDevToolsAgent* devtools_agent_; | 98 SharedWorkerDevToolsAgent* devtools_agent_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(WebWorkerClientProxy); | 100 DISALLOW_COPY_AND_ASSIGN(WebWorkerClientProxy); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ | 103 #endif // CONTENT_WORKER_WEBWORKERCLIENT_PROXY_H_ |
| OLD | NEW |