mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 13:56:29 +00:00
r=marklin
bug=7785 a=edburns Change nsIThreadManager::GetCurrentThread(PRUint32 *result) to nsIThreadManager::GetCurrentThread(nsPluginThread* *result)
This commit is contained in:
parent
ec0053b9d3
commit
8d3843239c
@ -41,6 +41,8 @@
|
||||
|
||||
class nsIRunnable;
|
||||
|
||||
typedef struct _nsPluginThread nsPluginThread;
|
||||
|
||||
class nsIThreadManager : public nsISupports {
|
||||
public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITHREADMANAGER_IID)
|
||||
@ -49,7 +51,7 @@ public:
|
||||
* Returns a unique identifier for the "current" system thread.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetCurrentThread(PRUint32* threadID) = 0;
|
||||
GetCurrentThread(nsPluginThread* *threadID) = 0;
|
||||
|
||||
/**
|
||||
* Pauses the current thread for the specified number of milliseconds.
|
||||
|
@ -153,9 +153,9 @@ nsJVMManager::ShowJavaConsole(void)
|
||||
// nsIThreadManager:
|
||||
|
||||
NS_METHOD
|
||||
nsJVMManager::GetCurrentThread(PRUint32* threadID)
|
||||
nsJVMManager::GetCurrentThread(nsPluginThread* *threadID)
|
||||
{
|
||||
*threadID = PRUint32(PR_GetCurrentThread());
|
||||
*threadID = (nsPluginThread *) PR_GetCurrentThread();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
* Returns a unique identifier for the "current" system thread.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetCurrentThread(PRUint32* threadID);
|
||||
GetCurrentThread(nsPluginThread* *threadID);
|
||||
|
||||
/**
|
||||
* Pauses the current thread for the specified number of milliseconds.
|
||||
|
@ -150,7 +150,7 @@ const UInt32 MRJPlugin::kInterfaceCount = sizeof(sInterfaces) / sizeof(Interface
|
||||
|
||||
MRJPlugin::MRJPlugin()
|
||||
: SupportsMixin(this, sInterfaces, kInterfaceCount),
|
||||
mManager(NULL), mThreadManager(NULL), mSession(NULL), mConsole(NULL), mIsEnabled(false), mPluginThreadID(0)
|
||||
mManager(NULL), mThreadManager(NULL), mSession(NULL), mConsole(NULL), mIsEnabled(false), mPluginThreadID(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -503,10 +503,14 @@ MRJPluginInstance* MRJPlugin::getPluginInstance(JNIEnv* jenv)
|
||||
|
||||
Boolean MRJPlugin::inPluginThread()
|
||||
{
|
||||
PRUint32 currentThreadID = -1;
|
||||
Boolean result = false;
|
||||
nsPluginThread *currentThreadID = -1;
|
||||
if (mThreadManager != NULL)
|
||||
mThreadManager->GetCurrentThread(¤tThreadID);
|
||||
return (mPluginThreadID == currentThreadID);
|
||||
if ((NULL != currentThreadID) && (NULL != mPluginThreadID)) {
|
||||
result = (*mPluginThreadID == *currentThreadID);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#pragma mark *** MRJPluginInstance ***
|
||||
|
@ -237,7 +237,7 @@ private:
|
||||
nsIThreadManager* mThreadManager;
|
||||
MRJSession* mSession;
|
||||
MRJConsole* mConsole;
|
||||
PRUint32 mPluginThreadID;
|
||||
nsPluginThread *mPluginThreadID;
|
||||
Boolean mIsEnabled;
|
||||
|
||||
// support for SupportsMixin.
|
||||
|
Loading…
x
Reference in New Issue
Block a user