diff options
author | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 16:27:06 +0000 |
---|---|---|
committer | atwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 16:27:06 +0000 |
commit | 6898bbedb15bfddf91ea125e3ffde4b1789d9bf3 (patch) | |
tree | e3950c1d597f704af541572cfc39e9874131d667 /chrome/worker/webworker_stub.h | |
parent | 1bbe5f61a331b2fb3cd1c0e18cf3aefa7105e635 (diff) | |
download | chromium_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/webworker_stub.h')
-rw-r--r-- | chrome/worker/webworker_stub.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/chrome/worker/webworker_stub.h b/chrome/worker/webworker_stub.h new file mode 100644 index 0000000..d83a4b7 --- /dev/null +++ b/chrome/worker/webworker_stub.h @@ -0,0 +1,38 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_WORKER_WEB_WORKER_STUB_H_ +#define CHROME_WORKER_WEB_WORKER_STUB_H_ + +#include "chrome/worker/webworker_stub_base.h" +#include "chrome/worker/webworkerclient_proxy.h" +#include "googleurl/src/gurl.h" + +namespace WebKit { +class WebWorker; +} + +// This class creates a WebWorker, and translates incoming IPCs to the +// appropriate WebWorker APIs. +class WebWorkerStub : public WebWorkerStubBase { + public: + WebWorkerStub(const GURL& url, int route_id); + + // IPC::Channel::Listener implementation. + virtual void OnMessageReceived(const IPC::Message& message); + + private: + virtual ~WebWorkerStub(); + + void OnTerminateWorkerContext(); + void OnPostMessage(const string16& message, + const std::vector<int>& sent_message_port_ids, + const std::vector<int>& new_routing_ids); + + WebKit::WebWorker* impl_; + + DISALLOW_COPY_AND_ASSIGN(WebWorkerStub); +}; + +#endif // CHROME_WORKER_WEB_WORKER_STUB_H_ |