Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Unified Diff: ppapi/shared_impl/ppb_audio_shared.h

Issue 200283002: Fix the crash for the AudioShared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@open_resource3
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/nacl_irt/plugin_startup.cc ('k') | ppapi/shared_impl/ppb_audio_shared.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_audio_shared.h
diff --git a/ppapi/shared_impl/ppb_audio_shared.h b/ppapi/shared_impl/ppb_audio_shared.h
index c9fbd9cf4c2df62e235195e120cd6e4d3b32b53a..3549f441ba719429318fe5941abcd06dee158ed1 100644
--- a/ppapi/shared_impl/ppb_audio_shared.h
+++ b/ppapi/shared_impl/ppb_audio_shared.h
@@ -15,9 +15,7 @@
#include "ppapi/shared_impl/resource.h"
#include "ppapi/thunk/ppb_audio_api.h"
-#if defined(OS_NACL)
-#include "ppapi/nacl_irt/public/irt_ppapi.h"
-#endif
+struct PP_ThreadFunctions;
namespace ppapi {
@@ -85,11 +83,14 @@ class PPAPI_SHARED_EXPORT PPB_Audio_Shared
// was invoked properly.
static bool IsThreadFunctionReady();
-#if defined(OS_NACL)
+ // Sets whether this class is used for NaCl plugin.
+ // If this is set to true, SetThreadFunctions() must be called before
+ // this class is used.
+ static void SetNaClMode(bool value);
bbudge 2014/04/21 17:01:51 Would it ever make sense for this to be called wit
hidehiko 2014/04/21 17:25:56 I see. Done.
+
// 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.
@@ -116,15 +117,12 @@ 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.
AudioCallbackCombined callback_;
« no previous file with comments | « ppapi/nacl_irt/plugin_startup.cc ('k') | ppapi/shared_impl/ppb_audio_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698