summaryrefslogtreecommitdiffstats
path: root/chrome/worker/webworkerclient_proxy.h
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 16:27:06 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 16:27:06 +0000
commit6898bbedb15bfddf91ea125e3ffde4b1789d9bf3 (patch)
treee3950c1d597f704af541572cfc39e9874131d667 /chrome/worker/webworkerclient_proxy.h
parent1bbe5f61a331b2fb3cd1c0e18cf3aefa7105e635 (diff)
downloadchromium_src-6898bbedb15bfddf91ea125e3ffde4b1789d9bf3.zip
chromium_src-6898bbedb15bfddf91ea125e3ffde4b1789d9bf3.tar.gz
chromium_src-6898bbedb15bfddf91ea125e3ffde4b1789d9bf3.tar.bz2
Added beginnings of browser-process support for shared workers.
Refactored WebWorkerClientProxy into two classes - WebWorkerDispatcher which dispatches incoming IPCs for the worker, and WebWorkerClientProxy, which handles outgoing API calls from WebWorkerImpl. This allows WebWorkerClientProxy to be reused by WebSharedWorkerDispatcher. BUG=26233 TEST=none (will enable layout tests when basic functionality available) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31077 Review URL: http://codereview.chromium.org/351004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker/webworkerclient_proxy.h')
-rw-r--r--chrome/worker/webworkerclient_proxy.h26
1 files changed, 7 insertions, 19 deletions
diff --git a/chrome/worker/webworkerclient_proxy.h b/chrome/worker/webworkerclient_proxy.h
index 456ecb0..b422912 100644
--- a/chrome/worker/webworkerclient_proxy.h
+++ b/chrome/worker/webworkerclient_proxy.h
@@ -9,7 +9,6 @@
#include "base/basictypes.h"
#include "base/task.h"
-#include "googleurl/src/gurl.h"
#include "ipc/ipc_channel.h"
#include "webkit/api/public/WebWorkerClient.h"
@@ -17,15 +16,17 @@ 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,
- public IPC::Channel::Listener {
+class WebWorkerClientProxy : public WebKit::WebWorkerClient {
public:
- WebWorkerClientProxy(const GURL& url, int route_id);
+ WebWorkerClientProxy(int route_id, WebWorkerStubBase* stub);
+ ~WebWorkerClientProxy();
// WebWorkerClient implementation.
virtual void postMessageToWorkerObject(
@@ -55,26 +56,13 @@ class WebWorkerClientProxy : public WebKit::WebWorkerClient,
return NULL;
}
- // IPC::Channel::Listener implementation.
- virtual void OnMessageReceived(const IPC::Message& message);
+ void EnsureWorkerContextTerminates();
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_;
-
- WebKit::WebWorker* impl_;
-
+ WebWorkerStubBase* stub_;
ScopedRunnableMethodFactory<WebWorkerClientProxy> kill_process_factory_;
DISALLOW_COPY_AND_ASSIGN(WebWorkerClientProxy);