diff options
Diffstat (limited to 'chrome/worker/webworkerclient_proxy.h')
-rw-r--r-- | chrome/worker/webworkerclient_proxy.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h index b422912..456ecb0 100644 --- a/chrome/worker/webworkerclient_proxy.h +++ b/chrome/worker/webworkerclient_proxy.h @@ -9,6 +9,7 @@ #include "base/basictypes.h" #include "base/task.h" +#include "googleurl/src/gurl.h" #include "ipc/ipc_channel.h" #include "webkit/api/public/WebWorkerClient.h" @@ -16,17 +17,15 @@ namespace WebKit { class WebWorker; } -class WebWorkerStubBase; - // This class receives IPCs from the renderer and calls the WebCore::Worker // implementation (after the data types have been converted by glue code). It // is also called by the worker code and converts these function calls into // IPCs that are sent to the renderer, where they're converted back to function // calls by WebWorkerProxy. -class WebWorkerClientProxy : public WebKit::WebWorkerClient { +class WebWorkerClientProxy : public WebKit::WebWorkerClient, + public IPC::Channel::Listener { public: - WebWorkerClientProxy(int route_id, WebWorkerStubBase* stub); - ~WebWorkerClientProxy(); + WebWorkerClientProxy(const GURL& url, int route_id); // WebWorkerClient implementation. virtual void postMessageToWorkerObject( @@ -56,13 +55,26 @@ class WebWorkerClientProxy : public WebKit::WebWorkerClient { return NULL; } - void EnsureWorkerContextTerminates(); + // IPC::Channel::Listener implementation. + virtual void OnMessageReceived(const IPC::Message& message); private: + ~WebWorkerClientProxy(); + bool Send(IPC::Message* message); + void OnTerminateWorkerContext(); + void OnPostMessage(const string16& message, + const std::vector<int>& sent_message_port_ids, + const std::vector<int>& new_routing_ids); + + // The source url for this worker. + GURL url_; + int route_id_; - WebWorkerStubBase* stub_; + + WebKit::WebWorker* impl_; + ScopedRunnableMethodFactory<WebWorkerClientProxy> kill_process_factory_; DISALLOW_COPY_AND_ASSIGN(WebWorkerClientProxy); |