Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsPrincipal.cpp File Reference
#include "nscore.h"
#include "nsScriptSecurityManager.h"
#include "nsString.h"
#include "nsReadableUtils.h"
#include "plstr.h"
#include "nsCRT.h"
#include "nsIURI.h"
#include "nsIJARURI.h"
#include "nsNetUtil.h"
#include "nsJSPrincipals.h"
#include "nsVoidArray.h"
#include "nsHashtable.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsPrincipal.h"

Go to the source code of this file.


struct  CapabilityList


 NS_IMPL_QUERY_INTERFACE2_CI (nsPrincipal, nsIPrincipal, nsISerializable) NS_IMPL_CI_INTERFACE_GETTER2(nsPrincipal
 deleteElement (void *aElement, void *aData)
 AppendCapability (nsHashKey *aKey, void *aData, void *capListPtr)
 ReadAnnotationEntry (nsIObjectInputStream *aStream, nsHashKey **aKey, void **aData)
 FreeAnnotationEntry (nsIObjectInputStream *aStream, nsHashKey *aKey, void *aData)
 WriteScalarValue (nsIObjectOutputStream *aStream, void *aData)



Class Documentation

struct CapabilityList

Definition at line 690 of file nsPrincipal.cpp.

Collaboration diagram for CapabilityList:
Class Members
nsCString * denied
nsCString * granted

Function Documentation

AppendCapability ( nsHashKey *  aKey,
void aData,
void capListPtr 

Definition at line 697 of file nsPrincipal.cpp.

  CapabilityList* capList = (CapabilityList*)capListPtr;
  PRInt16 value = (PRInt16)NS_PTR_TO_INT32(aData);
  nsCStringKey* key = (nsCStringKey *)aKey;
  if (value == nsIPrincipal::ENABLE_GRANTED) {
    capList->granted->Append(key->GetString(), key->GetStringLength());
    capList->granted->Append(' ');
  else if (value == nsIPrincipal::ENABLE_DENIED) {
    capList->denied->Append(key->GetString(), key->GetStringLength());
    capList->denied->Append(' ');

  return PR_TRUE;
deleteElement ( void aElement,
void aData 

Definition at line 140 of file nsPrincipal.cpp.

  nsHashtable *ht = (nsHashtable *) aElement;
  delete ht;
  return PR_TRUE;

Here is the caller graph for this function:

FreeAnnotationEntry ( nsIObjectInputStream aStream,
nsHashKey *  aKey,
void aData 

Definition at line 842 of file nsPrincipal.cpp.

  delete aKey;
ReadAnnotationEntry ( nsIObjectInputStream aStream,
nsHashKey **  aKey,
void **  aData 

Definition at line 820 of file nsPrincipal.cpp.

  nsresult rv;
  nsCStringKey* key = new nsCStringKey(aStream, &rv);
  if (NS_FAILED(rv)) {
    return rv;

  PRUint32 value;
  rv = aStream->Read32(&value);
  if (NS_FAILED(rv)) {
    delete key;
    return rv;

  *aKey = key;
  *aData = (void*) value;
  return NS_OK;
WriteScalarValue ( nsIObjectOutputStream aStream,
void aData 

Definition at line 899 of file nsPrincipal.cpp.

  PRUint32 value = NS_PTR_TO_INT32(aData);

  return aStream->Write32(value);

Variable Documentation

Definition at line 70 of file nsPrincipal.cpp.