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 "MRJFrame.h"
#include "MRJConsole.h"
#include "EmbeddedFramePluginInstance.h"
#include "nsIServiceManager.h"
#include "nsMemory.h"
#include "nsIComponentManager.h"
#include "nsIJVMManager.h"
#include "nsIJVMPluginTagInfo.h"
#include "nsIPluginManager2.h"
#include "nsIPluginInstancePeer.h"
#include "nsIWindowlessPlugInstPeer.h"
#include "LiveConnectNativeMethods.h"
#include "CSecureEnv.h"
#include "EventFilter.h"
#include "nsObsoleteModuleLoading.h"
#include <Resources.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)
nsresult NSGetFactory (nsISupports *serviceManager, const nsCID &aClass, const char *aClassName, const char *aContractID, nsIFactory **aFactory)
pascal OSErr __initialize (const CFragInitBlock *initBlock)
pascal void __terminate (void)
pascal OSErr MRJPlugin__initialize (const CFragInitBlock *initBlock)
pascal void MRJPlugin__terminate (void)
static bool hasTagInfo (nsISupports *supports)

Variables

static nsIServiceManagertheServiceManager = NULL
static nsIServiceManagerObsoletetheServiceManagerObsolete = NULL
nsIPluginManagerthePluginManager
nsIPluginthePlugin
nsIPluginManager2thePluginManager2 = NULL
nsIMemorytheMemoryAllocator = NULL
FSSpec thePluginSpec
short thePluginRefnum = -1
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 264 of file MRJPlugin.cpp.


Function Documentation

pascal OSErr __initialize ( const CFragInitBlock *  initBlock)

Here is the caller graph for this function:

pascal void __terminate ( void  )

Here is the caller graph for this function:

static bool hasTagInfo ( nsISupports *  supports) [static]

Definition at line 646 of file MRJPlugin.cpp.

{
       nsIJVMPluginTagInfo* tagInfo;
       if (supports->QueryInterface(NS_GET_IID(nsIJVMPluginTagInfo), (void **)&tagInfo) == NS_OK) {
              NS_RELEASE(tagInfo);
              return true;
       }
       return false;
}

Here is the caller graph for this function:

pascal OSErr MRJPlugin__initialize ( const CFragInitBlock *  initBlock)

Definition at line 163 of file MRJPlugin.cpp.

{
       OSErr err = __initialize(initBlock);
       if (err != noErr) return err;

       if (initBlock->fragLocator.where == kDataForkCFragLocator) {
              thePluginSpec = *initBlock->fragLocator.u.onDisk.fileSpec;
       
              // is it always the case that the plugin's resource file is open now?
              thePluginRefnum = ::FSpOpenResFile(&thePluginSpec, fsRdPerm);
       }
       
       return noErr;
}

Here is the call graph for this function:

Definition at line 178 of file MRJPlugin.cpp.

{
#ifdef MRJPLUGIN_4X  
       // Make sure the event filters are removed.
       RemoveEventFilters();
#endif

       __terminate();

    // last ditch release of the memory allocator.
    if (theMemoryAllocator != NULL) {
        theMemoryAllocator->Release();
        theMemoryAllocator = NULL;
    }
}

Here is the call graph for this function:

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 114 of file MRJPlugin.cpp.

{
    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.
#ifdef MRJPLUGIN_4X    
        if (MRJPlugin::GetService(kMemoryCID, NS_GET_IID(nsIMemory), (void**)&theMemoryAllocator) != NS_OK)
            return NS_ERROR_FAILURE;
#else
        if (NS_FAILED(MRJPlugin::GetService("@mozilla.org/xpcom/memory-service;1", NS_GET_IID(nsIMemory), (void **)&theMemoryAllocator)))
            return NS_ERROR_FAILURE;
#endif
    }

    if (!aClass.Equals(kPluginCID))
        return NS_NOINTERFACE;

    MRJPlugin* pluginFactory = new MRJPlugin();
    if (!pluginFactory)
        return NS_ERROR_OUT_OF_MEMORY;

    pluginFactory->AddRef();
    *aFactory = pluginFactory;
    return NS_OK;
}

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 643 of file MRJPlugin.cpp.

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

Definition at line 644 of file MRJPlugin.cpp.

Definition at line 883 of file MRJPlugin.cpp.

Definition at line 75 of file MRJPlugin.cpp.

Definition at line 539 of file badapter.cpp.

Definition at line 538 of file badapter.cpp.

Definition at line 74 of file MRJPlugin.cpp.

short thePluginRefnum = -1

Definition at line 78 of file MRJPlugin.cpp.

Definition at line 77 of file MRJPlugin.cpp.

Definition at line 67 of file MRJPlugin.cpp.

Definition at line 68 of file MRJPlugin.cpp.