Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
MRJPlugin.cpp File Reference
#include "MRJPlugin.h"
#include "MRJSession.h"
#include "MRJContext.h"
#include "MRJConsole.h"
#include "EmbeddedFramePluginInstance.h"
#include "MRJFrame.h"
#include "nsIServiceManager.h"
#include "nsIServiceManagerObsolete.h"
#include "nsObsoleteModuleLoading.h"
#include "nsIMemory.h"
#include "nsIJVMManager.h"
#include "nsIJVMPluginTagInfo.h"
#include "nsIPluginManager2.h"
#include "nsIPluginInstancePeer.h"
#include "nsIWindowlessPlugInstPeer.h"
#include "LiveConnectNativeMethods.h"
#include "CSecureEnv.h"
#include <Resources.h>
#include <LaunchServices.h>
#include <string>
#include <CFBundle.h>

Go to the source code of this file.

Defines

#define NS_APPLET_MIME_TYPE   "application/x-java-applet"

Functions

static NS_DEFINE_IID (kPluginCID, NS_PLUGIN_CID)
static NS_DEFINE_IID (kPluginManagerCID, NS_PLUGINMANAGER_CID)
static NS_DEFINE_IID (kJVMManagerCID, NS_JVMMANAGER_CID)
static NS_DEFINE_IID (kIWindowlessPluginInstancePeerIID, NS_IWINDOWLESSPLUGININSTANCEPEER_IID)
static long getSystemVersion ()
nsresult NSGetFactory (nsISupports *serviceManager, const nsCID &aClass, const char *aClassName, const char *aContractID, nsIFactory **aFactory)
static char * getJavaConsolePath (char *path, UInt32 maxPathSize)
static bool hasTagInfo (nsISupports *supports)

Variables

nsIPluginManagerthePluginManager = NULL
nsIPluginManager2thePluginManager2 = NULL
nsIMemorytheMemoryAllocator = NULL
FSSpec thePluginSpec
short thePluginRefnum = -1
static nsIServiceManagertheServiceManager = NULL
 Bottleneck all uses of the service manager, and use the obsolete service manager if the modern one is unavailable.
static nsIServiceManagerObsoletetheServiceManagerObsolete = NULL
static const char * kGetCodeBaseScriptURL = "javascript:var href = window.location.href; href.substring(0, href.lastIndexOf('/') + 1)"
static const char * kGetDocumentBaseScriptURL = "javascript:window.location"
static MRJPluginInstancetheInstances = NULL

Define Documentation

#define NS_APPLET_MIME_TYPE   "application/x-java-applet"

Definition at line 319 of file MRJPlugin.cpp.


Function Documentation

static char* getJavaConsolePath ( char *  path,
UInt32  maxPathSize 
) [static]

Definition at line 424 of file MRJPlugin.cpp.

{
    path[0] = '\0';
    FSRef ref;
    OSErr err = FSFindFolder(kUserDomain, kDomainLibraryFolderType, true, &ref);
    if (err == noErr) {
        err = FSRefMakePath(&ref, (UInt8*) path, maxPathSize);
        const char kJavaConsoleLog[] = { "/Logs/Java Console.log" };
        int len = strlen(path);
        if (err == noErr && (len + sizeof(kJavaConsoleLog)) <= maxPathSize) {
            strcat(path + len, kJavaConsoleLog);
        }
    }
    return path;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static long getSystemVersion ( ) [static]

Definition at line 116 of file MRJPlugin.cpp.

{
    long version = 0;
    Gestalt(gestaltSystemVersion, &version);
    return version;
}

Here is the caller graph for this function:

static bool hasTagInfo ( nsISupports *  supports) [static]

Definition at line 701 of file MRJPlugin.cpp.

{
    nsIJVMPluginTagInfo* tagInfo;
    if (supports->QueryInterface(NS_GET_IID(nsIJVMPluginTagInfo), (void**)&tagInfo) == NS_OK) {
        NS_RELEASE(tagInfo);
        return true;
    }
    return false;
}
static NS_DEFINE_IID ( kPluginCID  ,
NS_PLUGIN_CID   
) [static]
static NS_DEFINE_IID ( kPluginManagerCID  ,
NS_PLUGINMANAGER_CID   
) [static]
static NS_DEFINE_IID ( kJVMManagerCID  ,
NS_JVMMANAGER_CID   
) [static]
static NS_DEFINE_IID ( kIWindowlessPluginInstancePeerIID  ,
NS_IWINDOWLESSPLUGININSTANCEPEER_IID   
) [static]
nsresult NSGetFactory ( nsISupports *  serviceManager,
const nsCID aClass,
const char *  aClassName,
const char *  aContractID,
nsIFactory **  aFactory 
)

Definition at line 124 of file MRJPlugin.cpp.

{
    nsresult result = NS_OK;

    // First off, fail if not running on AT LEAST Mac OS X, v10.1.
    if (getSystemVersion() < 0x00001010)
        return NS_ERROR_FAILURE;

    if (theServiceManager == NULL && theServiceManagerObsolete == NULL) {
        if (NS_FAILED(serviceManager->QueryInterface(NS_GET_IID(nsIServiceManager), (void**)&theServiceManager)))
            if (NS_FAILED(serviceManager->QueryInterface(NS_GET_IID(nsIServiceManagerObsolete), (void**)&theServiceManagerObsolete)))
                return NS_ERROR_FAILURE;

        // Our global operator new wants to use nsIMalloc to do all of its allocation.
        // This should be available from the Service Manager.
        if (NS_FAILED(MRJPlugin::GetService("@mozilla.org/xpcom/memory-service;1", NS_GET_IID(nsIMemory), (void **)&theMemoryAllocator)))
            return NS_ERROR_FAILURE;
    }

    if (aClass.Equals(kPluginCID)) {
        MRJPlugin* pluginFactory = new MRJPlugin();
        pluginFactory->AddRef();
        *aFactory = pluginFactory;
        return NS_OK;
    }
    return NS_NOINTERFACE;
}

Here is the call graph for this function:


Variable Documentation

const char* kGetCodeBaseScriptURL = "javascript:var href = window.location.href; href.substring(0, href.lastIndexOf('/') + 1)" [static]

Definition at line 698 of file MRJPlugin.cpp.

const char* kGetDocumentBaseScriptURL = "javascript:window.location" [static]

Definition at line 699 of file MRJPlugin.cpp.

Definition at line 929 of file MRJPlugin.cpp.

Definition at line 76 of file MRJPlugin.cpp.

Definition at line 74 of file MRJPlugin.cpp.

Definition at line 75 of file MRJPlugin.cpp.

short thePluginRefnum = -1

Definition at line 79 of file MRJPlugin.cpp.

Definition at line 78 of file MRJPlugin.cpp.

Bottleneck all uses of the service manager, and use the obsolete service manager if the modern one is unavailable.

Definition at line 93 of file MRJPlugin.cpp.

Definition at line 94 of file MRJPlugin.cpp.