diff options
author | sehr@google.com <sehr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 00:30:51 +0000 |
---|---|---|
committer | sehr@google.com <sehr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-29 00:30:51 +0000 |
commit | 07506b507533d46e7ef826819ec9c5cbca5035aa (patch) | |
tree | 6cfc1f745d2703904174adec70eb60fe1d089861 /chrome/worker/nativewebworker_stub.h | |
parent | 241415acc358cbfb1054c2f4f8510ecbe6fe8c29 (diff) | |
download | chromium_src-07506b507533d46e7ef826819ec9c5cbca5035aa.zip chromium_src-07506b507533d46e7ef826819ec9c5cbca5035aa.tar.gz chromium_src-07506b507533d46e7ef826819ec9c5cbca5035aa.tar.bz2 |
Added stub native web worker support, including build support in preparation
for integrating the native client build.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker/nativewebworker_stub.h')
-rw-r--r-- | chrome/worker/nativewebworker_stub.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/chrome/worker/nativewebworker_stub.h b/chrome/worker/nativewebworker_stub.h new file mode 100644 index 0000000..6afe1db --- /dev/null +++ b/chrome/worker/nativewebworker_stub.h @@ -0,0 +1,63 @@ +// 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_NATIVEWORKER_STUB_H_ +#define CHROME_WORKER_NATIVEWORKER_STUB_H_ +// Native WebWorker support stub header. + +#include <stddef.h> + +// As we are not including the native client header files, several types +// from them need to be named outside of structure/method declarations to +// avoid compiler warnings/errors. + +struct NaClApp; +struct NaClDesc; +struct NaClSrpcChannel; + +namespace WebKit { +class WebWorkerClient; +} + +extern "C" { +// The thunk type used by upcall (postMessage from worker) handling. +typedef void (*NativeWorkerPostMessageFunc)(const char *str, + WebKit::WebWorkerClient* client); + +// Start a native webworker from the module in buffer. +int NaClStartNativeWebWorker(char *buffer, + size_t buf_len, + struct NaClApp **nap, + struct NaClSrpcChannel **untrusted_channel); + +// Performs a postMessage to the worker. +int NaClPostMessageToNativeWebWorker(char *buffer, + size_t buf_len, + struct NaClApp **nap, + struct NaClSrpcChannel **untrusted_ch); + +// Causes a native web worker to be shut down. +int NaClTerminateNativeWebWorker(struct NaClApp **nap, + struct NaClSrpcChannel **untrusted_channel); + +// Creates a channel that can be used to receive upcalls (postMessage from +// a worker). +int NaClCreateUpcallChannel(struct NaClDesc* desc[2]); + +// Part of the initialization of a worker. Sends the descriptor to the +// worker library to indicate where to send postMessage RPCs. +int NaClSrpcSendUpcallDesc(struct NaClSrpcChannel *channel, + struct NaClDesc *nacl_desc); + +// Runs an SRPC server loop on the specified channel. The post_message_func +// is invoked whenever the "postMessage" RPC is received. +int NaClSrpcListenerLoop(struct NaClDesc *chrome_desc, + NativeWorkerPostMessageFunc func, + WebKit::WebWorkerClient* client); + +// Destroys the upcall channel. +void NaClDestroyUpcallChannel(struct NaClDesc* desc[2]); +} + +#endif // CHROME_WORKER_NATIVEWORKER_STUB_H_ |