summaryrefslogtreecommitdiffstats
path: root/webkit/api/public
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 21:38:03 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 21:38:03 +0000
commitc36a24cbfdc6cb945f104d65174ef2aaa59e5dd3 (patch)
tree6f77d943b793b1f6968660c2ce3fb32f432369ed /webkit/api/public
parentc28a6aac0d9687b43781bb21fdef3b6849c0d398 (diff)
downloadchromium_src-c36a24cbfdc6cb945f104d65174ef2aaa59e5dd3.zip
chromium_src-c36a24cbfdc6cb945f104d65174ef2aaa59e5dd3.tar.gz
chromium_src-c36a24cbfdc6cb945f104d65174ef2aaa59e5dd3.tar.bz2
First half of updating Worker.postMessage(), DOMWindow.postMessage(), and
MessagePort.postMessage() to accept multiple MessagePorts. Original review: http://codereview.chromium.org/173193 TBR=atwilson TEST=None (new functionality not yet exposed via bindings, so existing tests suffice) BUG=19948 Review URL: http://codereview.chromium.org/174566 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24536 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api/public')
-rw-r--r--webkit/api/public/WebMessagePortChannel.h9
-rw-r--r--webkit/api/public/WebVector.h2
-rw-r--r--webkit/api/public/WebWorker.h8
-rw-r--r--webkit/api/public/WebWorkerClient.h8
4 files changed, 15 insertions, 12 deletions
diff --git a/webkit/api/public/WebMessagePortChannel.h b/webkit/api/public/WebMessagePortChannel.h
index ef20df4..20c0a33 100644
--- a/webkit/api/public/WebMessagePortChannel.h
+++ b/webkit/api/public/WebMessagePortChannel.h
@@ -32,11 +32,14 @@
#define WebMessagePortChannel_h
#include "WebCommon.h"
+#include "WebVector.h"
namespace WebKit {
class WebMessagePortChannelClient;
class WebString;
+ typedef WebVector<class WebMessagePortChannel*> WebMessagePortChannelArray;
+
// Provides an interface to a Message Port Channel implementation. The object owns itself and
// is signalled that its not needed anymore with the destroy() call.
class WebMessagePortChannel {
@@ -45,9 +48,9 @@ namespace WebKit {
virtual void destroy() = 0;
// WebKit versions of WebCore::MessagePortChannel.
virtual void entangle(WebMessagePortChannel*) = 0;
- // If sending a message port, callee receives ownership of the object.
- virtual void postMessage(const WebString&, WebMessagePortChannel*) = 0;
- virtual bool tryGetMessage(WebString*, WebMessagePortChannel**) = 0;
+ // Callee receives ownership of the passed vector.
+ virtual void postMessage(const WebString&, WebMessagePortChannelArray*) = 0;
+ virtual bool tryGetMessage(WebString*, WebMessagePortChannelArray&) = 0;
protected:
~WebMessagePortChannel() { }
diff --git a/webkit/api/public/WebVector.h b/webkit/api/public/WebVector.h
index af811d6..4919c85 100644
--- a/webkit/api/public/WebVector.h
+++ b/webkit/api/public/WebVector.h
@@ -31,7 +31,7 @@
#ifndef WebVector_h
#define WebVector_h
-#include <utility>
+#include <algorithm>
#include "WebCommon.h"
diff --git a/webkit/api/public/WebWorker.h b/webkit/api/public/WebWorker.h
index 480b34a..1424161 100644
--- a/webkit/api/public/WebWorker.h
+++ b/webkit/api/public/WebWorker.h
@@ -31,10 +31,9 @@
#ifndef WebWorker_h
#define WebWorker_h
-#include "WebCommon.h"
+#include "WebMessagePortChannel.h"
namespace WebKit {
- class WebMessagePortChannel;
class WebString;
class WebURL;
class WebWorkerClient;
@@ -50,8 +49,9 @@ namespace WebKit {
const WebString& userAgent,
const WebString& sourceCode) = 0;
virtual void terminateWorkerContext() = 0;
- virtual void postMessageToWorkerContext(const WebString&,
- WebMessagePortChannel*) = 0;
+ virtual void postMessageToWorkerContext(
+ const WebString&,
+ const WebMessagePortChannelArray&) = 0;
virtual void workerObjectDestroyed() = 0;
};
diff --git a/webkit/api/public/WebWorkerClient.h b/webkit/api/public/WebWorkerClient.h
index 3e89ed7..b9d8cef 100644
--- a/webkit/api/public/WebWorkerClient.h
+++ b/webkit/api/public/WebWorkerClient.h
@@ -31,10 +31,9 @@
#ifndef WebWorkerClient_h
#define WebWorkerClient_h
-#include "WebCommon.h"
+#include "WebMessagePortChannel.h"
namespace WebKit {
- class WebMessagePortChannel;
class WebString;
class WebWorker;
@@ -43,8 +42,9 @@ namespace WebKit {
// the Worker object, unless noted.
class WebWorkerClient {
public:
- virtual void postMessageToWorkerObject(const WebString&,
- WebMessagePortChannel*) = 0;
+ virtual void postMessageToWorkerObject(
+ const WebString&,
+ const WebMessagePortChannelArray&) = 0;
virtual void postExceptionToWorkerObject(
const WebString& errorString, int lineNumber,