Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsPermissionManager.cpp File Reference
#include "nsPermissionManager.h"
#include "nsPermission.h"
#include "nsCRT.h"
#include "nsNetUtil.h"
#include "nsILineInputStream.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsVoidArray.h"
#include "prprf.h"
#include "plarena.h"

Go to the source code of this file.

Classes

class  nsPermissionEnumerator

Defines

#define PL_ARENA_CONST_ALIGN_MASK   3
#define HOST_ARENA_SIZE   512

Functions

static char * ArenaStrDup (const char *str, PLArenaPool *aArena)
 AddHostToList (nsHostEntry *entry, void *arg)
 AddEntryToList (nsHostEntry *entry, void *arg)

Variables

static PLArenaPoolgHostArena = nsnull
static const char kPermissionsFileName [] = "hostperm.1"
static const char kOldPermissionsFileName [] = "cookperm.txt"
static const char kPermissionChangeNotification [] = PERM_CHANGE_NOTIFICATION
static const PRUint32 kLazyWriteTimeout = 2000
static const char kTab = '\t'
static const char kNew = '\n'
static const char kTrue = 'T'
static const char kFalse = 'F'
static const char kFirstLetter = 'a'
static const char kTypeSign = '%'
static const char kMatchTypeHost [] = "host"

Define Documentation

Definition at line 57 of file nsPermissionManager.cpp.

Definition at line 50 of file nsPermissionManager.cpp.


Function Documentation

AddEntryToList ( nsHostEntry entry,
void arg 
)

Definition at line 801 of file nsPermissionManager.cpp.

{
  // arg is a double-ptr to an entry in the hostList array,
  // so we dereference it twice to assign the |nsHostEntry*|
  // and once so we can increment the |nsHostEntry**| array location
  // ready for the next assignment.
  nsHostEntry*** elementPtr = NS_STATIC_CAST(nsHostEntry***, arg);
  **elementPtr = entry;
  ++(*elementPtr);
  return PL_DHASH_NEXT;
}

Here is the caller graph for this function:

AddHostToList ( nsHostEntry entry,
void arg 
)

Definition at line 431 of file nsPermissionManager.cpp.

{
  // arg is a double-ptr to an string entry in the hostList array,
  // so we dereference it twice to assign the |const char*| string
  // and once so we can increment the |const char**| array location
  // ready for the next assignment.
  const char*** elementPtr = NS_STATIC_CAST(const char***, arg);
  **elementPtr = entry->GetKey();
  ++(*elementPtr);
  return PL_DHASH_NEXT;
}
static char* ArenaStrDup ( const char *  str,
PLArenaPool aArena 
) [static]

Definition at line 62 of file nsPermissionManager.cpp.

{
  void* mem;
  const PRUint32 size = strlen(str) + 1;
  PL_ARENA_ALLOCATE(mem, aArena, size);
  if (mem)
    memcpy(mem, str, size);
  return NS_STATIC_CAST(char*, mem);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 53 of file nsPermissionManager.cpp.

const char kFalse = 'F' [static]

Definition at line 606 of file nsPermissionManager.cpp.

const char kFirstLetter = 'a' [static]

Definition at line 607 of file nsPermissionManager.cpp.

const PRUint32 kLazyWriteTimeout = 2000 [static]

Definition at line 184 of file nsPermissionManager.cpp.

const char kMatchTypeHost[] = "host" [static]

Definition at line 610 of file nsPermissionManager.cpp.

const char kNew = '\n' [static]

Definition at line 604 of file nsPermissionManager.cpp.

const char kOldPermissionsFileName[] = "cookperm.txt" [static]

Definition at line 181 of file nsPermissionManager.cpp.

Definition at line 182 of file nsPermissionManager.cpp.

const char kPermissionsFileName[] = "hostperm.1" [static]

Definition at line 180 of file nsPermissionManager.cpp.

const char kTab = '\t' [static]

Definition at line 603 of file nsPermissionManager.cpp.

const char kTrue = 'T' [static]

Definition at line 605 of file nsPermissionManager.cpp.

const char kTypeSign = '%' [static]

Definition at line 608 of file nsPermissionManager.cpp.