This commit is contained in:
beard%netscape.com 1999-05-08 16:33:40 +00:00
Родитель 0fea208890
Коммит fe7b181a91
6 изменённых файлов: 72 добавлений и 0 удалений

Просмотреть файл

@ -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;
};
////////////////////////////////////////////////////////////////////////////////