Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsCNullSecurityContext Class Reference

#include <nsCNullSecurityContext.h>

Inheritance diagram for nsCNullSecurityContext:
Inheritance graph
[legend]
Collaboration diagram for nsCNullSecurityContext:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS NS_IMETHOD Implies (const char *target, const char *action, PRBool *bActionAllowed)
 Get the security context to be used in LiveConnect.
NS_IMETHOD GetOrigin (char *buf, int len)
 Get the origin associated with the context.
NS_IMETHOD GetCertificateID (char *buf, int len)
 Get the certificate associated with the context.
 nsCNullSecurityContext ()

Detailed Description

Definition at line 44 of file nsCNullSecurityContext.h.


Constructor & Destructor Documentation

Definition at line 92 of file nsCNullSecurityContext.h.

{ };

Member Function Documentation

NS_IMETHODIMP nsCNullSecurityContext::GetCertificateID ( char *  buf,
int  len 
) [virtual]

Get the certificate associated with the context.

Parameters:
buf-- Result buffer (managed by the caller.)
len-- Buffer length.
Returns:
-- NS_OK if the codebase string was obtained. -- NS_FALSE otherwise.

Implements nsISecurityContext.

Definition at line 67 of file nsCNullSecurityContext.cpp.

NS_IMETHODIMP nsCNullSecurityContext::GetOrigin ( char *  buf,
int  len 
) [virtual]

Get the origin associated with the context.

Parameters:
buf-- Result buffer (managed by the caller.)
len-- Buffer length.
Returns:
-- NS_OK if the codebase string was obtained. -- NS_FALSE otherwise.

Implements nsISecurityContext.

Definition at line 52 of file nsCNullSecurityContext.cpp.

{
    if (buf == NULL)
       return NS_ERROR_NULL_POINTER;
    
    const char origin[] = "file:///";
    PRInt32 originLen = (PRInt32) (sizeof(origin) - 1);
    if (len <= originLen) {
        return NS_ERROR_NULL_POINTER;
    }
    // Copy origin
    memcpy(buf, origin, originLen);
    return NS_OK;
}

Here is the call graph for this function:

NS_IMETHODIMP nsCNullSecurityContext::Implies ( const char *  target,
const char *  action,
PRBool bActionAllowed 
) [virtual]

Get the security context to be used in LiveConnect.

This is used for JavaScript <--> Java.

Parameters:
target-- Possible target.
action-- Possible action on the target.
Returns:
-- NS_OK if the target and action is permitted -- NS_FALSE otherwise.

Implements nsISecurityContext.

Definition at line 45 of file nsCNullSecurityContext.cpp.

{    
    /* Avoid security check, returns true always */
    *bActionAllowed = PR_TRUE;
    return NS_OK;    
}

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