зеркало из https://github.com/mozilla/gecko-dev.git
[not part of build] fix bustage caused by checkins for bug #124042.
This commit is contained in:
Родитель
81f57168cc
Коммит
1d88c59bdd
|
@ -42,14 +42,11 @@
|
|||
|
||||
#include "LiveConnectNativeMethods.h"
|
||||
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIComponentManagerObsolete.h"
|
||||
#include "nsIPluginManager.h"
|
||||
#include "nsIJVMManager.h"
|
||||
#include "nsILiveconnect.h"
|
||||
#include "nsIPluginInstancePeer2.h"
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsNetCID.h"
|
||||
|
||||
#include "MRJPlugin.h"
|
||||
#include "MRJContext.h"
|
||||
|
@ -68,7 +65,7 @@ extern nsIPluginManager* thePluginManager;
|
|||
|
||||
static MRJPlugin* theJVMPlugin = NULL;
|
||||
static nsILiveconnect* theLiveConnectManager = NULL;
|
||||
static nsIComponentManager* theComponentManager = NULL;
|
||||
static nsIComponentManagerObsolete* theComponentManager = NULL;
|
||||
|
||||
static jclass netscape_javascript_JSObject = NULL;
|
||||
static jmethodID netscape_javascript_JSObject_JSObject;
|
||||
|
@ -83,9 +80,9 @@ static jmethodID netscape_oji_JNIUtils_GetObjectClassLoader = NULL;
|
|||
static NS_DEFINE_IID(kLiveConnectCID, NS_CLIVECONNECT_CID);
|
||||
static NS_DEFINE_IID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
||||
|
||||
static nsresult getGlobalComponentManager(nsIComponentManager* *result)
|
||||
static nsresult getGlobalComponentManager(nsIComponentManagerObsolete* *result)
|
||||
{
|
||||
return MRJPlugin::GetService(kComponentManagerCID, NS_GET_IID(nsIComponentManager), (void**)result);
|
||||
return MRJPlugin::GetService(kComponentManagerCID, NS_GET_IID(nsIComponentManagerObsolete), (void**)result);
|
||||
}
|
||||
|
||||
nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin)
|
||||
|
@ -150,7 +147,6 @@ nsresult InitLiveConnectSupport(MRJPlugin* jvmPlugin)
|
|||
nsresult ShutdownLiveConnectSupport()
|
||||
{
|
||||
NS_IF_RELEASE(theLiveConnectManager);
|
||||
|
||||
NS_IF_RELEASE(theComponentManager);
|
||||
|
||||
if (theJVMPlugin != NULL) {
|
||||
|
@ -199,26 +195,22 @@ static jobject GetCurrentThread(JNIEnv* env)
|
|||
* Security Considerations.
|
||||
*/
|
||||
|
||||
static nsresult
|
||||
NS_NewURI(nsIURI* *result,
|
||||
const char* spec,
|
||||
nsIURI* baseURI = nsnull) // pass in nsIIOService to optimize callers
|
||||
{
|
||||
nsIIOService* ioService;
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
nsresult rv = MRJPlugin::GetService(kIOServiceCID, NS_GET_IID(nsIIOService), (void**)&ioService);
|
||||
if (rv == NS_OK)
|
||||
rv = ioService->NewURI(spec, baseURI, result);
|
||||
NS_RELEASE(ioService);
|
||||
return rv;
|
||||
}
|
||||
|
||||
MRJSecurityContext::MRJSecurityContext(const char* location)
|
||||
: mLocation(nsnull), mConnection(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
NS_NewURI(&mLocation, location, nsnull);
|
||||
mLocation = ::strdup(location);
|
||||
if (mLocation) {
|
||||
// find the 3rd slash of the URL, hopefully it's in canonical form.
|
||||
char* colon = ::strchr(mLocation, ':');
|
||||
if (colon) {
|
||||
if (colon[1] == '/' && colon[2] == '/') {
|
||||
char* slash = ::strchr(colon + 3, '/');
|
||||
if (slash) *slash = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (theComponentManager) {
|
||||
theComponentManager->CreateInstance(kLiveConnectCID, nsnull, NS_GET_IID(nsILiveconnect),
|
||||
|
@ -231,7 +223,7 @@ MRJSecurityContext::MRJSecurityContext(const char* location)
|
|||
|
||||
MRJSecurityContext::~MRJSecurityContext()
|
||||
{
|
||||
NS_IF_RELEASE(mLocation);
|
||||
delete[] mLocation;
|
||||
NS_IF_RELEASE(mConnection);
|
||||
}
|
||||
|
||||
|
@ -248,9 +240,8 @@ NS_METHOD
|
|||
MRJSecurityContext::GetOrigin(char* buf, int len)
|
||||
{
|
||||
char* origin = nsnull;
|
||||
if (mLocation && NS_SUCCEEDED(mLocation->GetPrePath(&origin))) {
|
||||
::strncpy(buf, origin, len);
|
||||
delete[] origin;
|
||||
if (mLocation) {
|
||||
::strncpy(buf, mLocation, len);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -260,7 +251,6 @@ NS_METHOD
|
|||
MRJSecurityContext::GetCertificateID(char* buf, int len)
|
||||
{
|
||||
// ACTION: Implement me.
|
||||
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include "nsISecurityContext.h"
|
||||
|
||||
class nsIURI;
|
||||
class nsILiveconnect;
|
||||
|
||||
class MRJSecurityContext : public nsISecurityContext {
|
||||
|
@ -55,6 +54,6 @@ public:
|
|||
nsILiveconnect* getConnection() { return mConnection; }
|
||||
|
||||
private:
|
||||
nsIURI* mLocation;
|
||||
char* mLocation;
|
||||
nsILiveconnect* mConnection;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче