added GetJSContext()
git-svn-id: svn://10.0.0.236/trunk@30824 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f667d78822
commit
40ffb6fae1
@ -22,6 +22,7 @@
|
||||
#include "nsIPluginInstancePeer.h"
|
||||
|
||||
struct JSObject;
|
||||
struct JSContext;
|
||||
|
||||
// {e7d48c00-e1f1-11d2-8360-fbc8abc4ae7c}
|
||||
#define NS_IPLUGININSTANCEPEER2_IID \
|
||||
@ -54,6 +55,15 @@ public:
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetJSThread(PRUint32 *outThreadID) = 0;
|
||||
|
||||
/**
|
||||
* Get the JavaScript context to this plugin instance.
|
||||
*
|
||||
* @param outContext - the resulting JavaScript context
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetJSContext(JSContext* *outContext) = 0;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -803,6 +803,29 @@ NS_IMETHODIMP nsPluginInstancePeerImpl::GetJSThread(PRUint32 *outThreadID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginInstancePeerImpl::GetJSContext(JSContext* *outContext)
|
||||
{
|
||||
*outContext = NULL;
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
#if defined(OJI)
|
||||
nsIDocument* document = nsnull;
|
||||
if (mOwner->GetDocument(&document) == NS_OK) {
|
||||
nsIScriptContextOwner* contextOwner = document->GetScriptContextOwner();
|
||||
if (nsnull != contextOwner) {
|
||||
nsIScriptContext* context = nsnull;
|
||||
if (contextOwner->GetScriptContext(&context) == NS_OK) {
|
||||
*outContext = (JSContext*) context->GetNativeContext();
|
||||
NS_RELEASE(context);
|
||||
rv = NS_OK;
|
||||
}
|
||||
NS_RELEASE(contextOwner);
|
||||
}
|
||||
NS_RELEASE(document);
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult nsPluginInstancePeerImpl::Initialize(nsIPluginInstanceOwner *aOwner,
|
||||
const nsMIMEType aMIMEType)
|
||||
{
|
||||
|
||||
@ -66,6 +66,9 @@ public:
|
||||
NS_IMETHOD
|
||||
GetJSThread(PRUint32 *outThreadID);
|
||||
|
||||
NS_IMETHOD
|
||||
GetJSContext(JSContext* *outContext);
|
||||
|
||||
// nsIWindowlessPluginInstancePeer
|
||||
|
||||
// (Corresponds to NPN_InvalidateRect.)
|
||||
|
||||
@ -803,6 +803,29 @@ NS_IMETHODIMP nsPluginInstancePeerImpl::GetJSThread(PRUint32 *outThreadID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginInstancePeerImpl::GetJSContext(JSContext* *outContext)
|
||||
{
|
||||
*outContext = NULL;
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
#if defined(OJI)
|
||||
nsIDocument* document = nsnull;
|
||||
if (mOwner->GetDocument(&document) == NS_OK) {
|
||||
nsIScriptContextOwner* contextOwner = document->GetScriptContextOwner();
|
||||
if (nsnull != contextOwner) {
|
||||
nsIScriptContext* context = nsnull;
|
||||
if (contextOwner->GetScriptContext(&context) == NS_OK) {
|
||||
*outContext = (JSContext*) context->GetNativeContext();
|
||||
NS_RELEASE(context);
|
||||
rv = NS_OK;
|
||||
}
|
||||
NS_RELEASE(contextOwner);
|
||||
}
|
||||
NS_RELEASE(document);
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult nsPluginInstancePeerImpl::Initialize(nsIPluginInstanceOwner *aOwner,
|
||||
const nsMIMEType aMIMEType)
|
||||
{
|
||||
|
||||
@ -66,6 +66,9 @@ public:
|
||||
NS_IMETHOD
|
||||
GetJSThread(PRUint32 *outThreadID);
|
||||
|
||||
NS_IMETHOD
|
||||
GetJSContext(JSContext* *outContext);
|
||||
|
||||
// nsIWindowlessPluginInstancePeer
|
||||
|
||||
// (Corresponds to NPN_InvalidateRect.)
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
#include "nsIPluginInstancePeer.h"
|
||||
|
||||
struct JSObject;
|
||||
struct JSContext;
|
||||
|
||||
// {e7d48c00-e1f1-11d2-8360-fbc8abc4ae7c}
|
||||
#define NS_IPLUGININSTANCEPEER2_IID \
|
||||
@ -54,6 +55,15 @@ public:
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetJSThread(PRUint32 *outThreadID) = 0;
|
||||
|
||||
/**
|
||||
* Get the JavaScript context to this plugin instance.
|
||||
*
|
||||
* @param outContext - the resulting JavaScript context
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetJSContext(JSContext* *outContext) = 0;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user