Back to index

lightning-sunbird  0.9+nobinonly
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
CPluginManager Class Reference
Inheritance diagram for CPluginManager:
Inheritance graph
[legend]
Collaboration diagram for CPluginManager:
Collaboration graph
[legend]

List of all members.

Classes

struct  RegisteredWindow

Public Member Functions

voidoperator new (size_t size)
void operator delete (void *ptr)
 CPluginManager (void)
virtual ~CPluginManager (void)
NS_DECL_ISUPPORTS NS_IMETHOD GetValue (nsPluginManagerVariable variable, void *value)
NS_IMETHOD SetValue (nsPluginManagerVariable variable, void *value)
NS_IMETHOD ReloadPlugins (PRBool reloadPages)
NS_IMETHOD UserAgent (const char **result)
NS_IMETHOD GetURL (nsISupports *pluginInst, const char *url, const char *target=NULL, nsIPluginStreamListener *streamListener=NULL, const char *altHost=NULL, const char *referrer=NULL, PRBool forceJSEnabled=PR_FALSE)
 Fetches a URL.
NS_IMETHOD PostURL (nsISupports *pluginInst, const char *url, PRUint32 postDataLen, const char *postData, PRBool isFile=PR_FALSE, const char *target=NULL, nsIPluginStreamListener *streamListener=NULL, const char *altHost=NULL, const char *referrer=NULL, PRBool forceJSEnabled=PR_FALSE, PRUint32 postHeadersLength=0, const char *postHeaders=NULL)
 Posts to a URL with post data and/or post headers.
NS_IMETHOD RegisterPlugin (REFNSIID aCID, const char *aPluginName, const char *aDescription, const char **aMimeTypes, const char **aMimeDescriptions, const char **aFileExtensions, PRInt32 aCount)
NS_IMETHOD UnregisterPlugin (REFNSIID aCID)
NS_IMETHOD RegisterService (const nsCID &aClass, nsISupports *aService)
 RegisterService may be called explicitly to register a service with the service manager.
NS_IMETHOD UnregisterService (const nsCID &aClass)
 Requests a service to be shut down, possibly unloading its DLL.
NS_IMETHOD GetService (const nsCID &aClass, const nsIID &aIID, nsISupports **result, nsIShutdownListener *shutdownListener=NULL)
NS_IMETHOD ReleaseService (const nsCID &aClass, nsISupports *service, nsIShutdownListener *shutdownListener=NULL)
NS_IMETHOD GetService (const char *aContractID, const nsIID &aIID, nsISupports **result, nsIShutdownListener *shutdownListener=NULL)
NS_IMETHOD ReleaseService (const char *aContractID, nsISupports *service, nsIShutdownListener *shutdownListener=NULL)
 Alloc (PRUint32 size)
 Allocates a block of memory of a particular size.
 Realloc (void *ptr, PRUint32 size)
 Reallocates a block of memory to a new size.
NS_IMETHOD Free (void *ptr)
 Frees a block of memory.
NS_IMETHOD HeapMinimize (void)
 Attempts to shrink the heap.
voidoperator new (size_t size)
void operator delete (void *ptr)
 CPluginManager (void)
virtual ~CPluginManager (void)
NS_DECL_ISUPPORTS NS_IMETHOD GetValue (nsPluginManagerVariable variable, void *value)
 Returns the value of a variable associated with the plugin manager.
NS_IMETHOD ReloadPlugins (PRBool reloadPages)
 Causes the plugins directory to be searched again for new plugin libraries.
NS_IMETHOD UserAgent (const char **resultingAgentString)
 Returns the user agent string for the browser.
NS_IMETHOD GetURL (nsISupports *pluginInst, const char *url, const char *target=NULL, nsIPluginStreamListener *streamListener=NULL, const char *altHost=NULL, const char *referrer=NULL, PRBool forceJSEnabled=PR_FALSE)
 Fetches a URL.
NS_IMETHOD PostURL (nsISupports *pluginInst, const char *url, PRUint32 postDataLen, const char *postData, PRBool isFile=PR_FALSE, const char *target=NULL, nsIPluginStreamListener *streamListener=NULL, const char *altHost=NULL, const char *referrer=NULL, PRBool forceJSEnabled=PR_FALSE, PRUint32 postHeadersLength=0, const char *postHeaders=NULL)
 Posts to a URL with post data and/or post headers.
NS_IMETHOD RegisterPlugin (REFNSIID aCID, const char *aPluginName, const char *aDescription, const char **aMimeTypes, const char **aMimeDescriptions, const char **aFileExtensions, PRInt32 aCount)
NS_IMETHOD UnregisterPlugin (REFNSIID aCID)
NS_IMETHOD GetURLWithHeaders (nsISupports *pluginInst, const char *url, const char *target=NULL, nsIPluginStreamListener *streamListener=NULL, const char *altHost=NULL, const char *referrer=NULL, PRBool forceJSEnabled=PR_FALSE, PRUint32 getHeadersLength=0, const char *getHeaders=NULL)
 Fetches a URL, with Headers.
NS_IMETHOD BeginWaitCursor (void)
 Puts up a wait cursor.
NS_IMETHOD EndWaitCursor (void)
 Restores the previous (non-wait) cursor.
NS_IMETHOD SupportsURLProtocol (const char *protocol, PRBool *result)
 Returns true if a URL protocol (e.g.
NS_IMETHOD NotifyStatusChange (nsIPlugin *plugin, nsresult errorStatus)
 This method may be called by the plugin to indicate that an error has occurred, e.g.
NS_IMETHOD FindProxyForURL (const char *url, char **result)
 Returns the proxy info for a given URL.
NS_IMETHOD RegisterWindow (nsIEventHandler *handler, nsPluginPlatformWindowRef window)
 Registers a top-level window with the browser.
NS_IMETHOD UnregisterWindow (nsIEventHandler *handler, nsPluginPlatformWindowRef window)
 Unregisters a top-level window with the browser.
NS_IMETHOD AllocateMenuID (nsIEventHandler *handler, PRBool isSubmenu, PRInt16 *result)
 Allocates a new menu ID (for the Mac).
NS_IMETHOD DeallocateMenuID (nsIEventHandler *handler, PRInt16 menuID)
 Deallocates a menu ID (for the Mac).
NS_IMETHOD HasAllocatedMenuID (nsIEventHandler *handler, PRInt16 menuID, PRBool *result)
 Indicates whether this event handler has allocated the given menu ID.
NS_IMETHOD GetService (const nsCID &aClass, const nsIID &aIID, void **result)
NS_IMETHOD GetServiceByContractID (const char *aContractID, const nsIID &aIID, void **result)
NS_IMETHOD IsServiceInstantiated (const nsCID &aClass, const nsIID &aIID, PRBool *_retval)
NS_IMETHOD IsServiceInstantiatedByContractID (const char *aContractID, const nsIID &aIID, PRBool *_retval)
 Alloc (size_t size)
 Allocates a block of memory of a particular size.
 Realloc (void *ptr, size_t size)
 Reallocates a block of memory to a new size.
 Free (void *ptr)
 Frees a block of memory.
NS_IMETHOD IsLowMemory (PRBool *_retval)
NS_IMETHOD HeapMinimize (PRBool aImmediate)
 Attempts to shrink the heap.
void beginWaitCursor ()
 Puts up a wait cursor.
void endWaitCursor ()
 Restores the previous (non-wait) cursor.
void supportsURLProtocol (in string aProtocol, out boolean aResult)
 Returns true if a URL protocol (e.g.
void notifyStatusChange (in nsIPlugin aPlugin, in nsresult aStatus)
 This method may be called by the plugin to indicate that an error has occurred, e.g.
void findProxyForURL (in string aURL, out string aResult)
 Returns the proxy info for a given URL.
void registerWindow (in nsIEventHandler aHandler, in nsPluginPlatformWindowRef aWindow)
 Registers a top-level window with the browser.
void unregisterWindow (in nsIEventHandler aHandler, in nsPluginPlatformWindowRef aWindow)
 Unregisters a top-level window with the browser.
void allocateMenuID (in nsIEventHandler aHandler, in boolean aIsSubmenu, out short aResult)
 Allocates a new menu ID (for the Mac).
void deallocateMenuID (in nsIEventHandler aHandler, in short aMenuID)
 Deallocates a menu ID (for the Mac).
void hasAllocatedMenuID (in nsIEventHandler aHandler, in short aMenuID, out boolean aResult)
 Indicates whether this event handler has allocated the given menu ID.
void GetValue (in nsPluginManagerVariable variable, in nativeVoid value)
 Returns the value of a variable associated with the plugin manager.
void reloadPlugins (in boolean reloadPages)
 Causes the plugins directory to be searched again for new plugin libraries.
void UserAgent (in nativeChar resultingAgentString)
 Returns the user agent string for the browser.
void RegisterPlugin (in REFNSIID aCID, in string aPluginName, in string aDescription, in nativeChar aMimeTypes, in nativeChar aMimeDescriptions, in nativeChar aFileExtensions, in long aCount)
 Persistently register a plugin with the plugin manager.
void UnregisterPlugin (in REFNSIID aCID)
 Unregister a plugin from the plugin manager.
void getService (in nsCIDRef aClass, in nsIIDRef aIID,[iid_is(aIID), retval] out nsQIResult result)
 getServiceByContractID
void getServiceByContractID (in string aContractID, in nsIIDRef aIID,[iid_is(aIID), retval] out nsQIResult result)
boolean isServiceInstantiated (in nsCIDRef aClass, in nsIIDRef aIID)
 isServiceInstantiated
boolean isServiceInstantiatedByContractID (in string aContractID, in nsIIDRef aIID)
voidPtr alloc (in size_t size)
 Allocates a block of memory of a particular size.
voidPtr realloc (in voidPtr ptr, in size_t newSize)
 Reallocates a block of memory to a new size.
void free (in voidPtr ptr)
 Frees a block of memory.
void heapMinimize (in boolean immediate)
 Attempts to shrink the heap.
boolean isLowMemory ()
 This predicate can be used to determine if we're in a low-memory situation (what constitutes low-memory is platform dependent).

Static Private Member Functions

static RegisteredWindow ** GetRegisteredWindow (nsPluginPlatformWindowRef window)
static RegisteredWindowFindRegisteredWindow (nsPluginPlatformWindowRef window)

Private Attributes

nsILiveconnectmLiveconnect

Static Private Attributes

static RegisteredWindowtheRegisteredWindows = NULL
static RegisteredWindowtheActiveWindow = NULL

Detailed Description

Definition at line 70 of file badapter.cpp.


Constructor & Destructor Documentation

Definition at line 1073 of file badapter.cpp.

Here is the caller graph for this function:

Definition at line 1078 of file badapter.cpp.

virtual CPluginManager::~CPluginManager ( void  ) [virtual]

Member Function Documentation

voidPtr nsIMemory::alloc ( in size_t  size) [inherited]

Allocates a block of memory of a particular size.

If the memory cannot be allocated (because of an out-of-memory condition), null is returned.

Parameters:
size- the size of the block to allocate
Returns:
the block of memory

Allocates a block of memory of a particular size.

Parameters:
size- the size of the block to allocate
Returns:
the block of memory

Definition at line 1238 of file badapter.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CPluginManager::Alloc ( size_t  size)

Allocates a block of memory of a particular size.

Parameters:
size- the size of the block to allocate
Returns:
the block of memory

Definition at line 1978 of file BackwardAdapter.cpp.

Here is the call graph for this function:

void nsIPluginManager2::allocateMenuID ( in nsIEventHandler  aHandler,
in boolean  aIsSubmenu,
out short  aResult 
) [inherited]

Allocates a new menu ID (for the Mac).

Parameters:
aHandler- the event handler for the window
aIsSubmenu- whether this is a sub-menu ID or not
aResult- the resulting menu ID
Returns:
- NS_OK if this operation was successful
NS_METHOD CPluginManager::AllocateMenuID ( nsIEventHandler handler,
PRBool  isSubmenu,
PRInt16 result 
)

Allocates a new menu ID (for the Mac).

Parameters:
handler- the event handler for the window
isSubmenu- whether this is a sub-menu ID or not
result- the resulting menu ID
Returns:
- NS_OK if this operation was successful

Definition at line 1943 of file BackwardAdapter.cpp.

Puts up a wait cursor.

Returns:
- NS_OK if this operation was successful

Puts up a wait cursor.

Returns:
- NS_OK if this operation was successful

Definition at line 237 of file BackwardAdapter.cpp.

void nsIPluginManager2::deallocateMenuID ( in nsIEventHandler  aHandler,
in short  aMenuID 
) [inherited]

Deallocates a menu ID (for the Mac).

Parameters:
aHandler- the event handler for the window
aMenuID- the menu ID
Returns:
- NS_OK if this operation was successful

Deallocates a menu ID (for the Mac).

Parameters:
handler- the event handler for the window
menuID- the menu ID
Returns:
- NS_OK if this operation was successful

Definition at line 345 of file BackwardAdapter.cpp.

Restores the previous (non-wait) cursor.

Returns:
- NS_OK if this operation was successful

Restores the previous (non-wait) cursor.

Returns:
- NS_OK if this operation was successful

Definition at line 248 of file BackwardAdapter.cpp.

void nsIPluginManager2::findProxyForURL ( in string  aURL,
out string  aResult 
) [inherited]

Returns the proxy info for a given URL.

The caller is required to free the resulting memory with nsIMalloc::Free. The result will be in the following format

i) "DIRECT" -- no proxy ii) "PROXY xxx.xxx.xxx.xxx" -- use proxy iii) "SOCKS xxx.xxx.xxx.xxx" -- use SOCKS iv) Mixed. e.g. "PROXY 111.111.111.111;PROXY 112.112.112.112", "PROXY 111.111.111.111;SOCKS 112.112.112.112"....

Which proxy/SOCKS to use is determined by the plugin.

NS_IMETHOD CPluginManager::FindProxyForURL ( const char *  url,
char **  result 
) [inline]

Returns the proxy info for a given URL.

The caller is required to free the resulting memory with nsIMalloc::Free. The result will be in the following format

i) "DIRECT" -- no proxy ii) "PROXY xxx.xxx.xxx.xxx" -- use proxy iii) "SOCKS xxx.xxx.xxx.xxx" -- use SOCKS iv) Mixed. e.g. "PROXY 111.111.111.111;PROXY 112.112.112.112", "PROXY 111.111.111.111;SOCKS 112.112.112.112"....

Which proxy/SOCKS to use is determined by the plugin.

Definition at line 296 of file BackwardAdapter.cpp.

Definition at line 1710 of file BackwardAdapter.cpp.

{
       RegisteredWindow** link = GetRegisteredWindow(window);
       return (link != NULL ? *link : NULL);
}

Here is the call graph for this function:

void nsIMemory::free ( in voidPtr  ptr) [inherited]

Frees a block of memory.

Null is a permissible value, in which case nothing happens.

Parameters:
ptr- the block of memory to free

Frees a block of memory.

Parameters:
ptr- the block of memory to free

Definition at line 1258 of file badapter.cpp.

{
       if (ptr != NULL) {
              ::NPN_MemFree(ptr);
              return NS_OK;
       }
       return NS_ERROR_NULL_POINTER;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Frees a block of memory.

Parameters:
ptr- the block of memory to free

Definition at line 1697 of file BackwardAdapter.cpp.

{
       RegisteredWindow** link = &theRegisteredWindows;
       RegisteredWindow* registeredWindow = *link;
       while (registeredWindow != NULL) {
              if (registeredWindow->mWindow == window)
                     return link;
              link = &registeredWindow->mNext;
              registeredWindow = *link;
       }
       return NULL;
}

Here is the caller graph for this function:

void nsIServiceManager::getService ( in nsCIDRef  aClass,
in nsIIDRef  aIID,
[iid_is(aIID), retval] out nsQIResult  result 
) [inherited]

getServiceByContractID

Returns the instance that implements aClass or aContractID and the interface aIID. This may result in the instance being created.

Parameters:
aClassor aContractID : aClass or aContractID of object instance requested
aIID: IID of interface requested
result: resulting service
NS_METHOD CPluginManager::GetService ( const nsCID aClass,
const nsIID aIID,
nsISupports **  result,
nsIShutdownListener *  shutdownListener = NULL 
)

Definition at line 1211 of file badapter.cpp.

{
       // the only service we support currently is nsIAllocator.
       if (aClass.Equals(kPluginManagerCID) || aClass.Equals(kAllocatorCID)) {
              return QueryInterface(aIID, (void**) result);
       }
       if (aClass.Equals(nsILiveconnect::GetCID())) {
              if (mLiveconnect == NULL) {
                     mLiveconnect = new nsLiveconnect;
                     NS_IF_ADDREF(mLiveconnect);
              }
              return mLiveconnect->QueryInterface(aIID, result);
       }
       return NS_ERROR_SERVICE_NOT_FOUND;
}

Here is the call graph for this function:

NS_IMETHOD CPluginManager::GetService ( const char *  aContractID,
const nsIID aIID,
nsISupports **  result,
nsIShutdownListener *  shutdownListener = NULL 
) [inline]

Definition at line 173 of file badapter.cpp.

NS_METHOD CPluginManager::GetService ( const nsCID aClass,
const nsIID aIID,
void **  result 
)

Definition at line 1955 of file BackwardAdapter.cpp.

{
    // the only service we support currently is nsIMemory.
    if (aClass.Equals(kPluginManagerCID) || aClass.Equals(kMemoryCID)) {
        return QueryInterface(aIID, result);
    }
    if (!aClass.Equals(nsILiveconnect::GetCID())) {
        return NS_ERROR_SERVICE_NOT_FOUND;
    }
    if (mLiveconnect == NULL) {
        mLiveconnect = new nsLiveconnect;
        if (!mLiveconnect)
            return NS_ERROR_OUT_OF_MEMORY;
        NS_ADDREF(mLiveconnect);
    }
    return mLiveconnect->QueryInterface(aIID, result);
}

Here is the call graph for this function:

void nsIServiceManager::getServiceByContractID ( in string  aContractID,
in nsIIDRef  aIID,
[iid_is(aIID), retval] out nsQIResult  result 
) [inherited]
NS_IMETHOD CPluginManager::GetServiceByContractID ( const char *  aContractID,
const nsIID aIID,
void **  result 
) [inline]

Definition at line 371 of file BackwardAdapter.cpp.

NS_METHOD CPluginManager::GetURL ( nsISupports *  pluginInst,
const char *  url,
const char *  target = NULL,
nsIPluginStreamListener streamListener = NULL,
const char *  altHost = NULL,
const char *  referrer = NULL,
PRBool  forceJSEnabled = PR_FALSE 
) [virtual]

Fetches a URL.

(Corresponds to NPN_GetURL and NPN_GetURLNotify.)

Parameters:
pluginInst- the plugin making the request. If NULL, the URL is fetched in the background.
url- the URL to fetch
target- the target window into which to load the URL, or NULL if the data should be returned to the plugin via streamListener.
streamListener- a stream listener to be used to return data to the plugin. May be NULL if target is not NULL.
altHost- an IP-address string that will be used instead of the host specified in the URL. This is used to prevent DNS-spoofing attacks. Can be defaulted to NULL meaning use the host in the URL.
referrer- the referring URL (may be NULL)
forceJSEnabled- forces JavaScript to be enabled for 'javascript:' URLs, even if the user currently has JavaScript disabled (usually specify PR_FALSE)
Returns:
- NS_OK if this operation was successful

Implements nsIPluginManager.

Definition at line 1095 of file badapter.cpp.

{
    if (altHost != NULL || referrer != NULL || forceJSEnabled != PR_FALSE) {
        return NPERR_INVALID_PARAM;
    }

    nsIPluginInstance* inst = NULL;
    nsresult rslt = pluginInst->QueryInterface(NS_GET_IID(nsIPluginInstance), (void**)&inst);
    if (rslt != NS_OK) return rslt;
       CPluginInstancePeer* instancePeer = NULL;
    rslt = inst->GetPeer((nsIPluginInstancePeer**)&instancePeer);
    if (rslt != NS_OK) {
        inst->Release();
        return rslt;
    }
    NPP npp = instancePeer->GetNPPInstance();

    NPError err;
    if (streamListener) {
        CPluginInputStream* inStr = new CPluginInputStream(streamListener);
        if (inStr == NULL) {
            instancePeer->Release();
            inst->Release();
            return NS_ERROR_OUT_OF_MEMORY;
        }
        inStr->AddRef();
    
        err = NPN_GetURLNotify(npp, url, target, inStr);
    }
    else {
        err = NPN_GetURL(npp, url, target);
    }
    instancePeer->Release();
    inst->Release();
    return fromNPError[err];
}

Here is the call graph for this function:

NS_IMETHOD CPluginManager::GetURL ( nsISupports *  pluginInst,
const char *  url,
const char *  target = NULL,
nsIPluginStreamListener streamListener = NULL,
const char *  altHost = NULL,
const char *  referrer = NULL,
PRBool  forceJSEnabled = PR_FALSE 
) [virtual]

Fetches a URL.

(Corresponds to NPN_GetURL and NPN_GetURLNotify.)

Parameters:
pluginInst- the plugin making the request. If NULL, the URL is fetched in the background.
url- the URL to fetch
target- the target window into which to load the URL
notifyData- when present, URLNotify is called passing the notifyData back to the client. When NULL, this call behaves like NPN_GetURL.
altHost- an IP-address string that will be used instead of the host specified in the URL. This is used to prevent DNS-spoofing attacks. Can be defaulted to NULL meaning use the host in the URL.
referrer- the referring URL (may be NULL)
forceJSEnabled- forces JavaScript to be enabled for 'javascript:' URLs, even if the user currently has JavaScript disabled (usually specify PR_FALSE)
Returns:
- NS_OK if this operation was successful

Implements nsIPluginManager.

NS_IMETHODIMP CPluginManager::GetURLWithHeaders ( nsISupports *  pluginInst,
const char *  url,
const char *  target = NULL,
nsIPluginStreamListener streamListener = NULL,
const char *  altHost = NULL,
const char *  referrer = NULL,
PRBool  forceJSEnabled = PR_FALSE,
PRUint32  getHeadersLength = 0,
const char *  getHeaders = NULL 
) [virtual]

Fetches a URL, with Headers.

See also:
GetURL. Identical except for additional params headers and headersLen
Parameters:
getHeadersLength- the length of getHeaders (if non-NULL)
getHeaders- the headers to GET. Must be in the form of "HeaderName: HeaderValue\r\n". Each header, including the last, must be followed by "\r\n". NULL specifies that there are no get headers
Returns:
- NS_OK if this operation was successful

Implements nsIPluginManager.

Definition at line 1635 of file BackwardAdapter.cpp.

Definition at line 1304 of file badapter.cpp.

{
#ifdef XP_UNIX
    return fromNPError[NPN_GetValue(NULL, (NPNVariable)varMap[(int)variable], value)];
#else
    return fromNPError[NPERR_GENERIC_ERROR];
#endif // XP_UNIX
}

Here is the call graph for this function:

void nsIPluginManager::GetValue ( in nsPluginManagerVariable  variable,
in nativeVoid  value 
) [inherited]

Returns the value of a variable associated with the plugin manager.

(Corresponds to NPN_GetValue.)

Parameters:
variable- the plugin manager variable to get
value- the address of where to store the resulting value
Returns:
- NS_OK if this operation was successful

Returns the value of a variable associated with the plugin manager.

(Corresponds to NPN_GetValue.)

Parameters:
variable- the plugin manager variable to get
value- the address of where to store the resulting value
Returns:
- NS_OK if this operation was successful
void nsIPluginManager2::hasAllocatedMenuID ( in nsIEventHandler  aHandler,
in short  aMenuID,
out boolean  aResult 
) [inherited]

Indicates whether this event handler has allocated the given menu ID.

Parameters:
aHandler- the event handler for the window
aMenuID- the menu ID
aResult- returns PR_TRUE if the menu ID is allocated
Returns:
- NS_OK if this operation was successful
NS_IMETHOD CPluginManager::HasAllocatedMenuID ( nsIEventHandler handler,
PRInt16  menuID,
PRBool result 
) [inline]

Indicates whether this event handler has allocated the given menu ID.

Parameters:
handler- the event handler for the window
menuID- the menu ID
result- returns PR_TRUE if the menu ID is allocated
Returns:
- NS_OK if this operation was successful

Definition at line 359 of file BackwardAdapter.cpp.

void nsIMemory::heapMinimize ( in boolean  immediate) [inherited]

Attempts to shrink the heap.

Parameters:
immediate- if true, heap minimization will occur immediately if the call was made on the main thread. If false, the flush will be scheduled to happen when the app is idle.
Returns:
NS_ERROR_FAILURE if 'immediate' is set an the call was not on the application's main thread.

Attempts to shrink the heap.

Definition at line 1268 of file badapter.cpp.

{
#ifdef XP_MAC
       ::NPN_MemFlush(1024);
#endif
       return NS_OK;
}

Here is the call graph for this function:

Attempts to shrink the heap.

Definition at line 2006 of file BackwardAdapter.cpp.

{
#ifdef XP_MAC
       ::NPN_MemFlush(1024);
#endif
       return NS_OK;
}

Here is the call graph for this function:

This predicate can be used to determine if we're in a low-memory situation (what constitutes low-memory is platform dependent).

This can be used to trigger the memory pressure observers.

Definition at line 416 of file BackwardAdapter.cpp.

boolean nsIServiceManager::isServiceInstantiated ( in nsCIDRef  aClass,
in nsIIDRef  aIID 
) [inherited]

isServiceInstantiated

isServiceInstantiated will return a true if the service has already been created, otherwise false

Parameters:
aClassor aContractID : aClass or aContractID of object instance requested
aIID: IID of interface requested
aIID: IID of interface requested
NS_IMETHOD CPluginManager::IsServiceInstantiated ( const nsCID aClass,
const nsIID aIID,
PRBool _retval 
) [inline]

Definition at line 377 of file BackwardAdapter.cpp.

boolean nsIServiceManager::isServiceInstantiatedByContractID ( in string  aContractID,
in nsIIDRef  aIID 
) [inherited]
NS_IMETHOD CPluginManager::IsServiceInstantiatedByContractID ( const char *  aContractID,
const nsIID aIID,
PRBool _retval 
) [inline]

Definition at line 383 of file BackwardAdapter.cpp.

void nsIPluginManager2::notifyStatusChange ( in nsIPlugin  aPlugin,
in nsresult  aStatus 
) [inherited]

This method may be called by the plugin to indicate that an error has occurred, e.g.

that the plugin has failed or is shutting down spontaneously. This allows the browser to clean up any plugin-specific state.

Parameters:
aPlugin- the plugin whose status is changing
aStatus- the error status value
Returns:
- NS_OK if this operation was successful
NS_IMETHOD CPluginManager::NotifyStatusChange ( nsIPlugin plugin,
nsresult  errorStatus 
) [inline]

This method may be called by the plugin to indicate that an error has occurred, e.g.

that the plugin has failed or is shutting down spontaneously. This allows the browser to clean up any plugin-specific state.

Parameters:
plugin- the plugin whose status is changing
errorStatus- the the error status value
Returns:
- NS_OK if this operation was successful

Definition at line 277 of file BackwardAdapter.cpp.

void CPluginManager::operator delete ( void ptr) [inline]

Definition at line 74 of file badapter.cpp.

Here is the call graph for this function:

void CPluginManager::operator delete ( void ptr) [inline]

Definition at line 83 of file BackwardAdapter.cpp.

Here is the call graph for this function:

void* CPluginManager::operator new ( size_t  size) [inline]

Definition at line 73 of file badapter.cpp.

Here is the call graph for this function:

void* CPluginManager::operator new ( size_t  size) [inline]

Definition at line 82 of file BackwardAdapter.cpp.

Here is the call graph for this function:

NS_METHOD CPluginManager::PostURL ( nsISupports *  pluginInst,
const char *  url,
PRUint32  postDataLen,
const char *  postData,
PRBool  isFile = PR_FALSE,
const char *  target = NULL,
nsIPluginStreamListener streamListener = NULL,
const char *  altHost = NULL,
const char *  referrer = NULL,
PRBool  forceJSEnabled = PR_FALSE,
PRUint32  postHeadersLength = 0,
const char *  postHeaders = NULL 
) [virtual]

Posts to a URL with post data and/or post headers.

(Corresponds to NPN_PostURL and NPN_PostURLNotify.)

Parameters:
pluginInst- the plugin making the request. If NULL, the URL is fetched in the background.
url- the URL to fetch
postDataLength- the length of postData (if non-NULL)
postData- the data to POST. NULL specifies that there is not post data
isFile- whether the postData specifies the name of a file to post instead of data. The file will be deleted afterwards.
target- the target window into which to load the URL, or NULL if the data should be returned to the plugin via streamListener.
streamListener- a stream listener to be used to return data to the plugin. May be NULL if target is not NULL.
altHost- an IP-address string that will be used instead of the host specified in the URL. This is used to prevent DNS-spoofing attacks. Can be defaulted to NULL meaning use the host in the URL.
referrer- the referring URL (may be NULL)
forceJSEnabled- forces JavaScript to be enabled for 'javascript:' URLs, even if the user currently has JavaScript disabled (usually specify PR_FALSE)
postHeadersLength- the length of postHeaders (if non-NULL)
postHeaders- the headers to POST. Must be in the form of "HeaderName: HeaderValue\r\n". Each header, including the last, must be followed by "\r\n". NULL specifies that there are no post headers
Returns:
- NS_OK if this operation was successful

Implements nsIPluginManager.

Definition at line 1139 of file badapter.cpp.

{
    if (altHost != NULL || referrer != NULL || forceJSEnabled != PR_FALSE
        || postHeadersLength != 0 || postHeaders != NULL) {
        return NPERR_INVALID_PARAM;
    }

    nsIPluginInstance* inst = NULL;
    nsresult rslt = pluginInst->QueryInterface(NS_GET_IID(nsIPluginInstance), (void**)&inst);
    if (rslt != NS_OK) return rslt;
       CPluginInstancePeer* instancePeer = NULL;
    rslt = inst->GetPeer((nsIPluginInstancePeer**)&instancePeer);
    if (rslt != NS_OK) {
        inst->Release();
        return rslt;
    }
    NPP npp = instancePeer->GetNPPInstance();

    NPError err;
    if (streamListener) {
        CPluginInputStream* inStr = new CPluginInputStream(streamListener);
        if (inStr == NULL) {
            instancePeer->Release();
            inst->Release();
            return NS_ERROR_OUT_OF_MEMORY;
        }
        inStr->AddRef();
    
        err = NPN_PostURLNotify(npp, url, target, postDataLen, postData, isFile, inStr);
    }
    else {
        err = NPN_PostURL(npp, url, target, postDataLen, postData, isFile);
    }
    instancePeer->Release();
    inst->Release();
    return fromNPError[err];
}

Here is the call graph for this function:

NS_IMETHOD CPluginManager::PostURL ( nsISupports *  pluginInst,
const char *  url,
PRUint32  postDataLen,
const char *  postData,
PRBool  isFile = PR_FALSE,
const char *  target = NULL,
nsIPluginStreamListener streamListener = NULL,
const char *  altHost = NULL,
const char *  referrer = NULL,
PRBool  forceJSEnabled = PR_FALSE,
PRUint32  postHeadersLength = 0,
const char *  postHeaders = NULL 
) [virtual]

Posts to a URL with post data and/or post headers.

(Corresponds to NPN_PostURL and NPN_PostURLNotify.)

Parameters:
pluginInst- the plugin making the request. If NULL, the URL is fetched in the background.
url- the URL to fetch
target- the target window into which to load the URL
postDataLength- the length of postData (if non-NULL)
postData- the data to POST. NULL specifies that there is not post data
isFile- whether the postData specifies the name of a file to post instead of data. The file will be deleted afterwards.
notifyData- when present, URLNotify is called passing the notifyData back to the client. When NULL, this call behaves like NPN_GetURL.
altHost- an IP-address string that will be used instead of the host specified in the URL. This is used to prevent DNS-spoofing attacks. Can be defaulted to NULL meaning use the host in the URL.
referrer- the referring URL (may be NULL)
forceJSEnabled- forces JavaScript to be enabled for 'javascript:' URLs, even if the user currently has JavaScript disabled (usually specify PR_FALSE)
postHeadersLength- the length of postHeaders (if non-NULL)
postHeaders- the headers to POST. NULL specifies that there are no post headers
Returns:
- NS_OK if this operation was successful

Implements nsIPluginManager.

voidPtr nsIMemory::realloc ( in voidPtr  ptr,
in size_t  newSize 
) [inherited]

Reallocates a block of memory to a new size.

Parameters:
ptr- the block of memory to reallocate
size- the new size
Returns:
the reallocated block of memory

If ptr is null, this function behaves like malloc. If s is the size of the block to which ptr points, the first min(s, size) bytes of ptr's block are copied to the new block. If the allocation succeeds, ptr is freed and a pointer to the new block returned. If the allocation fails, ptr is not freed and null is returned. The returned value may be the same as ptr.

CPluginManager::Realloc ( void ptr,
PRUint32  size 
)

Reallocates a block of memory to a new size.

Parameters:
ptr- the block of memory to reallocate
size- the new size
Returns:
the rellocated block of memory

Definition at line 1244 of file badapter.cpp.

{
       if (ptr != NULL) {
              void* new_ptr = Alloc(size);
              if (new_ptr != NULL) {
                     ::memcpy(new_ptr, ptr, size);
                     Free(ptr);
              }
              ptr = new_ptr;
       }
       return ptr;
}

Here is the call graph for this function:

CPluginManager::Realloc ( void ptr,
size_t  size 
)

Reallocates a block of memory to a new size.

Parameters:
ptr- the block of memory to reallocate
size- the new size
Returns:
the rellocated block of memory

Definition at line 1984 of file BackwardAdapter.cpp.

{
       if (ptr != NULL) {
              void* new_ptr = Alloc(size);
              if (new_ptr != NULL) {
                     ::memcpy(new_ptr, ptr, size);
                     Free(ptr);
              }
              ptr = new_ptr;
       }
       return ptr;
}

Here is the call graph for this function:

NS_IMETHODIMP CPluginManager::RegisterPlugin ( REFNSIID  aCID,
const char *  aPluginName,
const char *  aDescription,
const char **  aMimeTypes,
const char **  aMimeDescriptions,
const char **  aFileExtensions,
PRInt32  aCount 
)

Definition at line 1190 of file badapter.cpp.

{
    // XXXwaterson I don't think we need to do anything here.
    return NS_OK;
}
NS_IMETHOD CPluginManager::RegisterPlugin ( REFNSIID  aCID,
const char *  aPluginName,
const char *  aDescription,
const char **  aMimeTypes,
const char **  aMimeDescriptions,
const char **  aFileExtensions,
PRInt32  aCount 
)
void nsIPluginManager::RegisterPlugin ( in REFNSIID  aCID,
in string  aPluginName,
in string  aDescription,
in nativeChar  aMimeTypes,
in nativeChar  aMimeDescriptions,
in nativeChar  aFileExtensions,
in long  aCount 
) [inherited]

Persistently register a plugin with the plugin manager.

aMimeTypes, aMimeDescriptions, and aFileExtensions are parallel arrays that contain information about the MIME types that the plugin supports.

Parameters:
aCID- the plugin's CID
aPluginName- the plugin's name
aDescription- a description of the plugin
aMimeTypes- an array of MIME types that the plugin is prepared to handle
aMimeDescriptions- an array of descriptions for the MIME types that the plugin can handle.
aFileExtensions- an array of file extensions for the MIME types that the plugin can handle.
aCount- the number of elements in the aMimeTypes, aMimeDescriptions, and aFileExtensions arrays.
Returns:
- NS_OK if the operation was successful.

Here is the caller graph for this function:

NS_IMETHOD CPluginManager::RegisterService ( const nsCID aClass,
nsISupports *  aService 
) [inline]

RegisterService may be called explicitly to register a service with the service manager.

If a service is not registered explicitly, the component manager will be used to create an instance according to the class ID specified.

Definition at line 142 of file badapter.cpp.

Registers a top-level window with the browser.

Events received by that window will be dispatched to the event handler specified.

Parameters:
aHandler- the event handler for the window
aWindow- the platform window reference
Returns:
- NS_OK if this operation was successful

Registers a top-level window with the browser.

Events received by that window will be dispatched to the event handler specified.

Parameters:
handler- the event handler for the window
window- the platform window reference
Returns:
- NS_OK if this operation was successful

Definition at line 1718 of file BackwardAdapter.cpp.

{
       theRegisteredWindows = new RegisteredWindow(theRegisteredWindows, handler, window);
       
#ifdef XP_MAC
       // use jGNE to obtain events for registered windows.
       if (!mEventFiltersInstalled) {
              ::InstallEventFilters(&EventFilter, &MenuFilter);
              mEventFiltersInstalled = true;
       }

       // plugin expects the window to be shown and selected at this point.
       
       SInt16 variant = ::GetWVariant(window);
       if (variant == plainDBox) {
              ::ShowHide(window, true);
              ::BringToFront(window);
       } else {
              ::ShowWindow(window);
              ::SelectWindow(window);
       }
#endif

       return NS_OK;
}

Here is the call graph for this function:

NS_METHOD CPluginManager::ReleaseService ( const nsCID aClass,
nsISupports *  service,
nsIShutdownListener *  shutdownListener = NULL 
)

Definition at line 1230 of file badapter.cpp.

{
       NS_RELEASE(service);
       return NS_OK;
}
NS_IMETHOD CPluginManager::ReleaseService ( const char *  aContractID,
nsISupports *  service,
nsIShutdownListener *  shutdownListener = NULL 
) [inline]

Definition at line 181 of file badapter.cpp.

Definition at line 1088 of file badapter.cpp.

{
    NPN_ReloadPlugins(reloadPages);
    return NS_OK;
}

Here is the call graph for this function:

void nsIPluginManager::reloadPlugins ( in boolean  reloadPages) [inherited]

Causes the plugins directory to be searched again for new plugin libraries.

(Corresponds to NPN_ReloadPlugins.)

Parameters:
reloadPages- indicates whether currently visible pages should also be reloaded

Causes the plugins directory to be searched again for new plugin libraries.

(Corresponds to NPN_ReloadPlugins.)

Parameters:
reloadPages- indicates whether currently visible pages should also be reloaded
Returns:
- NS_OK if this operation was successful

Definition at line 1318 of file badapter.cpp.

{
#ifdef XP_UNIX
    return fromNPError[NPN_SetValue(NULL, (NPPVariable)varMap[(int)variable], value)];
#else
    return fromNPError[NPERR_GENERIC_ERROR];
#endif // XP_UNIX
}

Here is the call graph for this function:

void nsIPluginManager2::supportsURLProtocol ( in string  aProtocol,
out boolean  aResult 
) [inherited]

Returns true if a URL protocol (e.g.

"http") is supported.

Parameters:
aProtocol- the protocol name
aResult- true if the protocol is supported
Returns:
- NS_OK if this operation was successful
NS_IMETHOD CPluginManager::SupportsURLProtocol ( const char *  protocol,
PRBool result 
) [inline]

Returns true if a URL protocol (e.g.

"http") is supported.

Parameters:
protocol- the protocol name
result- true if the protocol is supported
Returns:
- NS_OK if this operation was successful

Definition at line 261 of file BackwardAdapter.cpp.

Definition at line 1204 of file badapter.cpp.

{
    // XXXwaterson I don't think we need to do anything here.
    return NS_OK;
}

Unregister a plugin from the plugin manager.

Parameters:
aCIDthe CID of the plugin to unregister.
Returns:
- NS_OK if the operation was successful.

Here is the caller graph for this function:

Requests a service to be shut down, possibly unloading its DLL.

Returns:
NS_OK - if shutdown was successful and service was unloaded,
NS_ERROR_SERVICE_NOT_FOUND - if shutdown failed because the service was not currently loaded
NS_ERROR_SERVICE_IN_USE - if shutdown failed because some user of the service wouldn't voluntarily release it by using a shutdown listener.

Definition at line 158 of file badapter.cpp.

Unregisters a top-level window with the browser.

The handler and window pair should be the same as that specified to RegisterWindow.

Parameters:
aHandler- the event handler for the window
aWindow- the platform window reference
Returns:
- NS_OK if this operation was successful

Unregisters a top-level window with the browser.

The handler and window pair should be the same as that specified to RegisterWindow.

Parameters:
handler- the event handler for the window
window- the platform window reference
Returns:
- NS_OK if this operation was successful

Definition at line 1745 of file BackwardAdapter.cpp.

{
       RegisteredWindow** link = GetRegisteredWindow(window);
       if (link != NULL) {
              RegisteredWindow* registeredWindow = *link;
              if (registeredWindow == theActiveWindow)
                     theActiveWindow = NULL;
              *link = registeredWindow->mNext;
              delete registeredWindow;
       }

#ifdef XP_MAC
       ::HideWindow(window);

       // if no windows registered, remove the filter.
       if (theRegisteredWindows == NULL) {
              ::RemoveEventFilters();
              mEventFiltersInstalled = false;
       }
#endif

       return NS_OK;
}

Here is the call graph for this function:

Definition at line 1281 of file badapter.cpp.

{
    *result = NPN_UserAgent(NULL);
    return NS_OK;
}

Here is the call graph for this function:

void nsIPluginManager::UserAgent ( in nativeChar  resultingAgentString) [inherited]

Returns the user agent string for the browser.

(Corresponds to NPN_UserAgent.)

Parameters:
resultingAgentString- the resulting user agent string
NS_IMETHOD CPluginManager::UserAgent ( const char **  resultingAgentString)

Returns the user agent string for the browser.

(Corresponds to NPN_UserAgent.)

Parameters:
resultingAgentString- the resulting user agent string
Returns:
- NS_OK if this operation was successful

Member Data Documentation

Definition at line 221 of file badapter.cpp.

Definition at line 448 of file BackwardAdapter.cpp.

Definition at line 447 of file BackwardAdapter.cpp.


The documentation for this class was generated from the following files: