diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-25 21:47:31 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-25 21:47:31 +0000 |
commit | 420ade41729ee2ef0369acf8e172ee79eb007842 (patch) | |
tree | 9db39fedb252e1ebfe872809b8d166bc11d5997a /ppapi/shared_impl/ppb_audio_shared.h | |
parent | cb017d1edc4affc233a7e2c09f4920702e542ae6 (diff) | |
download | chromium_src-420ade41729ee2ef0369acf8e172ee79eb007842.zip chromium_src-420ade41729ee2ef0369acf8e172ee79eb007842.tar.gz chromium_src-420ade41729ee2ef0369acf8e172ee79eb007842.tar.bz2 |
Modify the PPB_Audio_Shared code for NaCl.
BUG=116317
TEST=none
This adds code for the NaCl untrusted build of the PPAPI proxy. The NaCl IRT can't
create threads that call back into user code, so the Audio thread must be created
using a special NaCl API.
Review URL: https://chromiumcodereview.appspot.com/10809079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/shared_impl/ppb_audio_shared.h')
-rw-r--r-- | ppapi/shared_impl/ppb_audio_shared.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ppapi/shared_impl/ppb_audio_shared.h b/ppapi/shared_impl/ppb_audio_shared.h index 3e8826e..cde075b 100644 --- a/ppapi/shared_impl/ppb_audio_shared.h +++ b/ppapi/shared_impl/ppb_audio_shared.h @@ -13,6 +13,10 @@ #include "ppapi/shared_impl/resource.h" #include "ppapi/thunk/ppb_audio_api.h" +#if defined(OS_NACL) +#include "native_client/src/untrusted/irt/irt_ppapi.h" +#endif + namespace ppapi { // Implements the logic to map shared memory and run the audio thread signaled @@ -54,6 +58,11 @@ class PPAPI_SHARED_EXPORT PPB_Audio_Shared size_t shared_memory_size, base::SyncSocket::Handle socket_handle); +#if defined(OS_NACL) + // NaCl has a special API for IRT code to create threads that can call back + // into user code. + static void SetThreadFunctions(const struct PP_ThreadFunctions* functions); +#endif private: // Starts execution of the audio thread. void StartThread(); @@ -79,8 +88,15 @@ class PPAPI_SHARED_EXPORT PPB_Audio_Shared // The size of the sample buffer in bytes. size_t shared_memory_size_; +#if !defined(OS_NACL) // When the callback is set, this thread is spawned for calling it. scoped_ptr<base::DelegateSimpleThread> audio_thread_; +#else + uintptr_t thread_id_; + bool thread_active_; + + static void CallRun(void* self); +#endif // Callback to call when audio is ready to accept new samples. PPB_Audio_Callback callback_; |