зеркало из https://github.com/mozilla/pjs.git
fix for bug #68338, r=mstoltz, sr=brendan, a=leaf
This commit is contained in:
Родитель
234eb9d4b5
Коммит
fbd9023f52
|
@ -171,6 +171,15 @@
|
|||
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>:::::dist:netwerk:</VALUE></SETTING>
|
||||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>:MacOS Support:</VALUE></SETTING>
|
||||
|
@ -180,6 +189,15 @@
|
|||
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING>
|
||||
<SETTING><NAME>SearchPath</NAME>
|
||||
<SETTING><NAME>Path</NAME><VALUE>:::::xpcom:macbuild:</VALUE></SETTING>
|
||||
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
|
||||
<SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
|
||||
<SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
|
||||
</SETTING>
|
||||
</SETTING>
|
||||
<SETTING><NAME>SystemSearchPaths</NAME>
|
||||
<SETTING>
|
||||
|
@ -828,13 +846,13 @@
|
|||
<SETTING><NAME>MWMerge_MacOS_copyResources</NAME><VALUE>1</VALUE></SETTING>
|
||||
<SETTING><NAME>MWMerge_MacOS_skipResources</NAME>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>i› </VALUE></SETTING>
|
||||
<SETTING><VALUE>ñ8</VALUE></SETTING>
|
||||
<SETTING><VALUE>Ñ0</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>üêØ</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
||||
<!-- Settings for "Perl Panel" panel -->
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE>€A</VALUE></SETTING>
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE></VALUE></SETTING>
|
||||
|
||||
<!-- Settings for "PPC CodeGen" panel -->
|
||||
<SETTING><NAME>MWCodeGen_PPC_structalignment</NAME><VALUE>PPC</VALUE></SETTING>
|
||||
|
@ -1182,6 +1200,15 @@
|
|||
<FILEKIND>Library</FILEKIND>
|
||||
<FILEFLAGS>Debug</FILEFLAGS>
|
||||
</FILE>
|
||||
<FILE>
|
||||
<PATHTYPE>PathRelative</PATHTYPE>
|
||||
<PATHROOT>Project</PATHROOT>
|
||||
<ACCESSPATH>:::::xpcom:macbuild:</ACCESSPATH>
|
||||
<PATH>:xpcom.shlb</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
<FILEKIND>Library</FILEKIND>
|
||||
<FILEFLAGS>Debug, WeakImport</FILEFLAGS>
|
||||
</FILE>
|
||||
</FILELIST>
|
||||
<LINKORDER>
|
||||
<FILEREF>
|
||||
|
@ -1379,6 +1406,13 @@
|
|||
<PATH>:Universal:Libraries:StubLibraries:TextCommon</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<PATHTYPE>PathRelative</PATHTYPE>
|
||||
<PATHROOT>Project</PATHROOT>
|
||||
<ACCESSPATH>:::::xpcom:macbuild:</ACCESSPATH>
|
||||
<PATH>:xpcom.shlb</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
</LINKORDER>
|
||||
<SUBTARGETLIST>
|
||||
<SUBTARGET>
|
||||
|
@ -2144,13 +2178,13 @@
|
|||
<SETTING><NAME>MWMerge_MacOS_copyResources</NAME><VALUE>1</VALUE></SETTING>
|
||||
<SETTING><NAME>MWMerge_MacOS_skipResources</NAME>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>i› </VALUE></SETTING>
|
||||
<SETTING><VALUE>ñ8</VALUE></SETTING>
|
||||
<SETTING><VALUE>Ñ0</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>üêØ</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
||||
<!-- Settings for "Perl Panel" panel -->
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE>€A</VALUE></SETTING>
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE></VALUE></SETTING>
|
||||
|
||||
<!-- Settings for "PPC CodeGen" panel -->
|
||||
<SETTING><NAME>MWCodeGen_PPC_structalignment</NAME><VALUE>PPC</VALUE></SETTING>
|
||||
|
@ -3071,13 +3105,13 @@
|
|||
<SETTING><NAME>MWMerge_MacOS_copyResources</NAME><VALUE>1</VALUE></SETTING>
|
||||
<SETTING><NAME>MWMerge_MacOS_skipResources</NAME>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>i› </VALUE></SETTING>
|
||||
<SETTING><VALUE>ñ8</VALUE></SETTING>
|
||||
<SETTING><VALUE>Ñ0</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>üêØ</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
||||
<!-- Settings for "Perl Panel" panel -->
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE>€A</VALUE></SETTING>
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE></VALUE></SETTING>
|
||||
|
||||
<!-- Settings for "PPC CodeGen" panel -->
|
||||
<SETTING><NAME>MWCodeGen_PPC_structalignment</NAME><VALUE>PPC</VALUE></SETTING>
|
||||
|
@ -4159,13 +4193,13 @@
|
|||
<SETTING><NAME>MWMerge_MacOS_copyResources</NAME><VALUE>1</VALUE></SETTING>
|
||||
<SETTING><NAME>MWMerge_MacOS_skipResources</NAME>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>i› </VALUE></SETTING>
|
||||
<SETTING><VALUE>ñ8</VALUE></SETTING>
|
||||
<SETTING><VALUE>Ñ0</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>üêØ</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
||||
<!-- Settings for "Perl Panel" panel -->
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE>€A</VALUE></SETTING>
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE></VALUE></SETTING>
|
||||
|
||||
<!-- Settings for "PPC CodeGen" panel -->
|
||||
<SETTING><NAME>MWCodeGen_PPC_structalignment</NAME><VALUE>MC68K</VALUE></SETTING>
|
||||
|
@ -5208,13 +5242,13 @@
|
|||
<SETTING><NAME>MWMerge_MacOS_copyResources</NAME><VALUE>1</VALUE></SETTING>
|
||||
<SETTING><NAME>MWMerge_MacOS_skipResources</NAME>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>i› </VALUE></SETTING>
|
||||
<SETTING><VALUE>ñ8</VALUE></SETTING>
|
||||
<SETTING><VALUE>Ñ0</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>üêØ</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
||||
<!-- Settings for "Perl Panel" panel -->
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE>€A</VALUE></SETTING>
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE></VALUE></SETTING>
|
||||
|
||||
<!-- Settings for "PPC CodeGen" panel -->
|
||||
<SETTING><NAME>MWCodeGen_PPC_structalignment</NAME><VALUE>PPC</VALUE></SETTING>
|
||||
|
@ -6436,13 +6470,13 @@
|
|||
<SETTING><NAME>MWMerge_MacOS_copyResources</NAME><VALUE>1</VALUE></SETTING>
|
||||
<SETTING><NAME>MWMerge_MacOS_skipResources</NAME>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>i› </VALUE></SETTING>
|
||||
<SETTING><VALUE>ñ8</VALUE></SETTING>
|
||||
<SETTING><VALUE>Ñ0</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
<SETTING><VALUE>üêØ</VALUE></SETTING>
|
||||
<SETTING><VALUE></VALUE></SETTING>
|
||||
</SETTING>
|
||||
|
||||
<!-- Settings for "Perl Panel" panel -->
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE>€A</VALUE></SETTING>
|
||||
<SETTING><NAME>Perl_Prefix_Filename</NAME><VALUE></VALUE></SETTING>
|
||||
|
||||
<!-- Settings for "PPC CodeGen" panel -->
|
||||
<SETTING><NAME>MWCodeGen_PPC_structalignment</NAME><VALUE>MC68K</VALUE></SETTING>
|
||||
|
@ -6940,6 +6974,14 @@
|
|||
<PATH>:NSStdLibStubs</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>MRJPlugin</TARGETNAME>
|
||||
<PATHTYPE>PathRelative</PATHTYPE>
|
||||
<PATHROOT>Project</PATHROOT>
|
||||
<ACCESSPATH>:::::xpcom:macbuild:</ACCESSPATH>
|
||||
<PATH>:xpcom.shlb</PATH>
|
||||
<PATHFORMAT>MacOS</PATHFORMAT>
|
||||
</FILEREF>
|
||||
<FILEREF>
|
||||
<TARGETNAME>MRJPlugin</TARGETNAME>
|
||||
<PATHTYPE>PathRelative</PATHTYPE>
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -47,6 +47,7 @@
|
|||
#include "nsIPluginManager2.h"
|
||||
#include "nsIPluginInstancePeer.h"
|
||||
#include "nsIJVMPluginTagInfo.h"
|
||||
#include "MRJSecurityContext.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -87,7 +88,7 @@ MRJContext::MRJContext(MRJSession* session, MRJPluginInstance* instance)
|
|||
: mPluginInstance(instance), mSession(session), mSessionRef(session->getSessionRef()), mPeer(NULL),
|
||||
mLocator(NULL), mContext(NULL), mViewer(NULL), mViewerFrame(NULL), mIsActive(false),
|
||||
mPluginWindow(NULL), mPluginClipping(NULL), mPluginPort(NULL),
|
||||
mDocumentBase(NULL), mAppletHTML(NULL), mPage(NULL)
|
||||
mDocumentBase(NULL), mAppletHTML(NULL), mPage(NULL), mSecurityContext(NULL)
|
||||
{
|
||||
instance->GetPeer(&mPeer);
|
||||
|
||||
|
@ -148,6 +149,11 @@ MRJContext::~MRJContext()
|
|||
delete[] mAppletHTML;
|
||||
mAppletHTML = NULL;
|
||||
}
|
||||
|
||||
if (mSecurityContext != NULL) {
|
||||
mSecurityContext->Release();
|
||||
mSecurityContext = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static char* slashify(char* url)
|
||||
|
@ -1652,6 +1658,18 @@ const char* MRJContext::getAppletHTML()
|
|||
return mAppletHTML;
|
||||
}
|
||||
|
||||
void MRJContext::setSecurityContext(MRJSecurityContext* context)
|
||||
{
|
||||
NS_ADDREF(context);
|
||||
NS_IF_RELEASE(mSecurityContext);
|
||||
mSecurityContext = context;
|
||||
}
|
||||
|
||||
MRJSecurityContext* MRJContext::getSecurityContext()
|
||||
{
|
||||
return mSecurityContext;
|
||||
}
|
||||
|
||||
MRJPage* MRJContext::findPage(const MRJPageAttributes& attributes)
|
||||
{
|
||||
MRJPage* page = MRJPage::getFirstPage();
|
||||
|
|
|
@ -48,6 +48,7 @@ struct nsPluginWindow;
|
|||
class MRJFrame;
|
||||
class MRJPage;
|
||||
struct MRJPageAttributes;
|
||||
class MRJSecurityContext;
|
||||
|
||||
struct nsPluginPoint {
|
||||
PRInt32 x;
|
||||
|
@ -101,6 +102,9 @@ public:
|
|||
void setAppletHTML(const char* appletHTML, nsPluginTagType tagType);
|
||||
const char* getAppletHTML();
|
||||
|
||||
void setSecurityContext(MRJSecurityContext* context);
|
||||
MRJSecurityContext* getSecurityContext();
|
||||
|
||||
private:
|
||||
void localToFrame(Point* pt);
|
||||
void ensureValidPort();
|
||||
|
@ -145,4 +149,5 @@ private:
|
|||
char* mDocumentBase;
|
||||
char* mAppletHTML;
|
||||
MRJPage* mPage;
|
||||
MRJSecurityContext* mSecurityContext;
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
nsLiveConnect.cpp
|
||||
nsLiveConnect.cpp
|
||||
*/
|
||||
|
||||
#include "nsLiveconnect.h"
|
||||
|
@ -33,103 +33,103 @@
|
|||
extern nsIPluginManager* thePluginManager;
|
||||
|
||||
const InterfaceInfo nsLiveconnect::sInterfaces[] = {
|
||||
{ NS_ILIVECONNECT_IID, INTERFACE_OFFSET(nsLiveconnect, nsILiveconnect) },
|
||||
{ NS_IPLUGINSTREAMLISTENER_IID, INTERFACE_OFFSET(nsLiveconnect, nsIPluginStreamListener) },
|
||||
{ NS_ILIVECONNECT_IID, INTERFACE_OFFSET(nsLiveconnect, nsILiveconnect) },
|
||||
{ NS_IPLUGINSTREAMLISTENER_IID, INTERFACE_OFFSET(nsLiveconnect, nsIPluginStreamListener) },
|
||||
};
|
||||
const UInt32 nsLiveconnect::kInterfaceCount = sizeof(sInterfaces) / sizeof(InterfaceInfo);
|
||||
|
||||
nsLiveconnect::nsLiveconnect()
|
||||
: SupportsMixin(this, sInterfaces, kInterfaceCount),
|
||||
mJavaScriptMonitor(NULL), mScript(NULL), mResult(NULL)
|
||||
: SupportsMixin(this, sInterfaces, kInterfaceCount),
|
||||
mJavaScriptMonitor(NULL), mScript(NULL), mResult(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
nsLiveconnect::~nsLiveconnect()
|
||||
{
|
||||
if (mJavaScriptMonitor != NULL)
|
||||
delete mJavaScriptMonitor;
|
||||
if (mJavaScriptMonitor != NULL)
|
||||
delete mJavaScriptMonitor;
|
||||
}
|
||||
|
||||
static char* u2c(const jchar *ustr, jsize length)
|
||||
{
|
||||
char* result = new char[length + 1];
|
||||
if (result != NULL) {
|
||||
char* cstr = result;
|
||||
while (length-- > 0) {
|
||||
*cstr++ = (char) *ustr++;
|
||||
}
|
||||
*cstr = '\0';
|
||||
}
|
||||
return result;
|
||||
char* result = new char[length + 1];
|
||||
if (result != NULL) {
|
||||
char* cstr = result;
|
||||
while (length-- > 0) {
|
||||
*cstr++ = (char) *ustr++;
|
||||
}
|
||||
*cstr = '\0';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const char* kJavaScriptPrefix = "javascript:";
|
||||
|
||||
NS_METHOD
|
||||
NS_METHOD
|
||||
nsLiveconnect::Eval(JNIEnv *env, jsobject obj, const jchar *script, jsize length, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext, jobject *outResult)
|
||||
int numPrincipals, nsISupports *securitySupports, jobject *outResult)
|
||||
{
|
||||
MRJPluginInstance* pluginInstance = (MRJPluginInstance*) obj;
|
||||
nsIPluginStreamListener* listener = this;
|
||||
MRJPluginInstance* pluginInstance = (MRJPluginInstance*) obj;
|
||||
nsIPluginStreamListener* listener = this;
|
||||
|
||||
if (mJavaScriptMonitor == NULL)
|
||||
mJavaScriptMonitor = new MRJMonitor(pluginInstance->getSession());
|
||||
if (mJavaScriptMonitor == NULL)
|
||||
mJavaScriptMonitor = new MRJMonitor(pluginInstance->getSession());
|
||||
|
||||
mJavaScriptMonitor->enter();
|
||||
mJavaScriptMonitor->enter();
|
||||
|
||||
while (mScript != NULL) {
|
||||
// some other thread is evaluating a script.
|
||||
mJavaScriptMonitor->wait();
|
||||
}
|
||||
|
||||
// convert the script to ASCII, construct a "javascript:" URL.
|
||||
char* cscript = u2c(script, length);
|
||||
mScript = new char[strlen(kJavaScriptPrefix) + length + 1];
|
||||
strcpy(mScript, kJavaScriptPrefix);
|
||||
strcat(mScript, cscript);
|
||||
delete[] cscript;
|
||||
nsresult result = thePluginManager->GetURL((nsIPluginInstance*)pluginInstance, mScript, NULL, listener);
|
||||
|
||||
// need to block until the result is ready.
|
||||
mJavaScriptMonitor->wait();
|
||||
|
||||
// default result is NULL, in case JavaScript returns undefined value.
|
||||
*outResult = NULL;
|
||||
while (mScript != NULL) {
|
||||
// some other thread is evaluating a script.
|
||||
mJavaScriptMonitor->wait();
|
||||
}
|
||||
|
||||
// convert the script to ASCII, construct a "javascript:" URL.
|
||||
char* cscript = u2c(script, length);
|
||||
mScript = new char[strlen(kJavaScriptPrefix) + length + 1];
|
||||
strcpy(mScript, kJavaScriptPrefix);
|
||||
strcat(mScript, cscript);
|
||||
delete[] cscript;
|
||||
nsresult result = thePluginManager->GetURL((nsIPluginInstance*)pluginInstance, mScript, NULL, listener);
|
||||
|
||||
// need to block until the result is ready.
|
||||
mJavaScriptMonitor->wait();
|
||||
|
||||
// default result is NULL, in case JavaScript returns undefined value.
|
||||
*outResult = NULL;
|
||||
|
||||
// result should now be ready, convert it to a Java string and return.
|
||||
if (mResult != NULL) {
|
||||
*outResult = env->NewStringUTF(mResult);
|
||||
delete[] mResult;
|
||||
mResult = NULL;
|
||||
}
|
||||
|
||||
delete[] mScript;
|
||||
mScript = NULL;
|
||||
|
||||
mJavaScriptMonitor->notifyAll();
|
||||
|
||||
mJavaScriptMonitor->exit();
|
||||
|
||||
return NS_OK;
|
||||
// result should now be ready, convert it to a Java string and return.
|
||||
if (mResult != NULL) {
|
||||
*outResult = env->NewStringUTF(mResult);
|
||||
delete[] mResult;
|
||||
mResult = NULL;
|
||||
}
|
||||
|
||||
delete[] mScript;
|
||||
mScript = NULL;
|
||||
|
||||
mJavaScriptMonitor->notifyAll();
|
||||
|
||||
mJavaScriptMonitor->exit();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsLiveconnect::OnDataAvailable(nsIPluginStreamInfo* pluginInfo, nsIInputStream* input, PRUint32 length)
|
||||
{
|
||||
// hopefully all our data is available.
|
||||
mResult = new char[length + 1];
|
||||
if (mResult != NULL) {
|
||||
if (input->Read(mResult, length, &length) == NS_OK) {
|
||||
// We've delayed processing the applet tag, because we
|
||||
// don't know the location of the curren document yet.
|
||||
mResult[length] = '\0';
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
// hopefully all our data is available.
|
||||
mResult = new char[length + 1];
|
||||
if (mResult != NULL) {
|
||||
if (input->Read(mResult, length, &length) == NS_OK) {
|
||||
// We've delayed processing the applet tag, because we
|
||||
// don't know the location of the curren document yet.
|
||||
mResult[length] = '\0';
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsLiveconnect::OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status)
|
||||
{
|
||||
// the stream has been closed, notify any waiting Java threads.
|
||||
mJavaScriptMonitor->notifyAll();
|
||||
return NS_OK;
|
||||
// the stream has been closed, notify any waiting Java threads.
|
||||
mJavaScriptMonitor->notifyAll();
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
nsLiveConnect.h
|
||||
nsLiveConnect.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
@ -32,14 +32,14 @@
|
|||
class MRJMonitor;
|
||||
|
||||
class nsLiveconnect : public nsILiveconnect,
|
||||
public nsIPluginStreamListener,
|
||||
private SupportsMixin {
|
||||
public nsIPluginStreamListener,
|
||||
private SupportsMixin {
|
||||
public:
|
||||
DECL_SUPPORTS_MIXIN
|
||||
|
||||
nsLiveconnect();
|
||||
virtual ~nsLiveconnect();
|
||||
|
||||
DECL_SUPPORTS_MIXIN
|
||||
|
||||
nsLiveconnect();
|
||||
virtual ~nsLiveconnect();
|
||||
|
||||
/**
|
||||
* get member of a Native JSObject for a given name.
|
||||
*
|
||||
|
@ -52,10 +52,10 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
GetMember(JNIEnv *env, jsobject jsobj, const jchar *name, jsize length, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext, jobject *pjobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
int numPrincipals, nsISupports *securitySupports, jobject *pjobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* get member of a Native JSObject for a given index.
|
||||
|
@ -67,10 +67,10 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
GetSlot(JNIEnv *env, jsobject jsobj, jint slot, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext, jobject *pjobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
int numPrincipals, nsISupports *securitySupports, jobject *pjobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* set member of a Native JSObject for a given name.
|
||||
|
@ -83,10 +83,10 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
SetMember(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length, jobject jobj, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
int numPrincipals, nsISupports *securitySupports)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* set member of a Native JSObject for a given index.
|
||||
|
@ -99,10 +99,10 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
SetSlot(JNIEnv *env, jsobject jsobj, jint slot, jobject jobj, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
int numPrincipals, nsISupports *securitySupports)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* remove member of a Native JSObject for a given name.
|
||||
|
@ -112,10 +112,10 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
RemoveMember(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
int numPrincipals, nsISupports *securitySupports)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* call a method of Native JSObject.
|
||||
|
@ -127,10 +127,10 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
Call(JNIEnv *env, jsobject jsobj, const jchar* name, jsize length, jobjectArray jobjArr, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext, jobject *pjobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
int numPrincipals, nsISupports *securitySupports, jobject *pjobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluate a script with a Native JS Object representing scope.
|
||||
|
@ -141,9 +141,9 @@ public:
|
|||
* @param script - Script to be executed.
|
||||
* @param pjobj - return value.
|
||||
*/
|
||||
NS_IMETHOD
|
||||
NS_IMETHOD
|
||||
Eval(JNIEnv *env, jsobject obj, const jchar *script, jsize length, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext, jobject *outResult);
|
||||
int numPrincipals, nsISupports *securitySupports, jobject *outResult);
|
||||
|
||||
/**
|
||||
* Get the window object for a plugin instance.
|
||||
|
@ -156,10 +156,10 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
GetWindow(JNIEnv *env, void *pJavaObject, void* principalsArray[],
|
||||
int numPrincipals, void *securityContext, jsobject *pobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
int numPrincipals, nsISupports *securitySupports, jsobject *pobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finalize a JSObject instance.
|
||||
|
@ -169,9 +169,9 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
FinalizeJSObject(JNIEnv *env, jsobject jsobj)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a JSObject to a string.
|
||||
|
@ -182,12 +182,12 @@ public:
|
|||
*/
|
||||
NS_IMETHOD
|
||||
ToString(JNIEnv *env, jsobject obj, jstring *pjstring)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
// nsIPluginStreamListener implementation.
|
||||
|
||||
// nsIPluginStreamListener implementation.
|
||||
|
||||
/**
|
||||
* Notify the observer that the URL has started to load. This method is
|
||||
* called only once, at the beginning of a URL load.<BR><BR>
|
||||
|
@ -198,7 +198,7 @@ public:
|
|||
NS_IMETHOD
|
||||
OnStartBinding(nsIPluginStreamInfo* pluginInfo)
|
||||
{
|
||||
return NS_OK;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -217,9 +217,9 @@ public:
|
|||
NS_IMETHOD
|
||||
OnFileAvailable(nsIPluginStreamInfo* pluginInfo, const char* fileName)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify the observer that the URL has finished loading. This method is
|
||||
* called once when the networking library has finished processing the
|
||||
|
@ -234,22 +234,22 @@ public:
|
|||
NS_IMETHOD
|
||||
OnStopBinding(nsIPluginStreamInfo* pluginInfo, nsresult status);
|
||||
|
||||
/**
|
||||
* What is this method supposed to do?
|
||||
*/
|
||||
/**
|
||||
* What is this method supposed to do?
|
||||
*/
|
||||
NS_IMETHOD
|
||||
GetStreamType(nsPluginStreamType *result)
|
||||
{
|
||||
*result = nsPluginStreamType_Normal;
|
||||
return NS_OK;
|
||||
*result = nsPluginStreamType_Normal;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
MRJMonitor* mJavaScriptMonitor;
|
||||
char* mScript;
|
||||
char* mResult;
|
||||
MRJMonitor* mJavaScriptMonitor;
|
||||
char* mScript;
|
||||
char* mResult;
|
||||
|
||||
// support for SupportsMixin.
|
||||
static const InterfaceInfo sInterfaces[];
|
||||
static const UInt32 kInterfaceCount;
|
||||
// support for SupportsMixin.
|
||||
static const InterfaceInfo sInterfaces[];
|
||||
static const UInt32 kInterfaceCount;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче