Back to index

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

List of all members.

Public Member Functions

 HistoryEntry ()
void OnVisited ()
PRInt64 GetLastVisitTime ()
void SetLastVisitTime (const PRInt64 &aTime)
PRBool GetIsWritten ()
void SetIsWritten (PRBool written=PR_TRUE)

Static Public Member Functions

static voidoperator new (size_t size) CPP_THROW_NEW
static void operator delete (void *p, size_t size)
static void ReleasePool ()

Static Private Member Functions

static nsresult InitPool ()

Private Attributes

PRInt64 mLastVisitTime
PRPackedBool mWritten

Static Private Attributes

static nsFixedSizeAllocator * sPool

Detailed Description

Definition at line 73 of file nsEmbedGlobalHistory.cpp.


Constructor & Destructor Documentation

Definition at line 75 of file nsEmbedGlobalHistory.cpp.

Here is the caller graph for this function:


Member Function Documentation

Definition at line 90 of file nsEmbedGlobalHistory.cpp.

                { return mWritten; }

Here is the caller graph for this function:

Definition at line 85 of file nsEmbedGlobalHistory.cpp.

                { return mLastVisitTime; }

Here is the caller graph for this function:

nsresult HistoryEntry::InitPool ( ) [static, private]

Definition at line 137 of file nsEmbedGlobalHistory.cpp.

{
  if (!sPool) {
    sPool = new nsFixedSizeAllocator;
    if (!sPool)
      return NS_ERROR_OUT_OF_MEMORY;

    static const size_t kBucketSizes[] =
      { sizeof(HistoryEntry) };
    static const PRInt32 kInitialPoolSize =
      NS_SIZE_IN_HEAP(sizeof(HistoryEntry)) * 256;

    nsresult rv = sPool->Init("EmbedLite HistoryEntry Pool", kBucketSizes, 1, kInitialPoolSize);
    if (NS_FAILED(rv))
      return rv;
  }
  return NS_OK;
}

Here is the call graph for this function:

Definition at line 79 of file nsEmbedGlobalHistory.cpp.

Here is the call graph for this function:

void HistoryEntry::operator delete ( void p,
size_t  size 
) [static]

Definition at line 124 of file nsEmbedGlobalHistory.cpp.

{
  if (!p)
    return;
  if (size != sizeof(HistoryEntry))
    ::operator delete(p);
  if (!sPool) {
    NS_ERROR("HistoryEntry outlived its memory pool");
    return;
  }
  sPool->Free(p, size);
}
void * HistoryEntry::operator new ( size_t  size) [static]

Definition at line 114 of file nsEmbedGlobalHistory.cpp.

{
  if (size != sizeof(HistoryEntry))
    return ::operator new(size);
  if (!sPool && NS_FAILED(InitPool()))
    return nsnull;
    
  return sPool->Alloc(size);
}

Here is the call graph for this function:

Definition at line 156 of file nsEmbedGlobalHistory.cpp.

{
  delete sPool;
  sPool = nsnull;
}

Here is the caller graph for this function:

void HistoryEntry::SetIsWritten ( PRBool  written = PR_TRUE) [inline]

Definition at line 92 of file nsEmbedGlobalHistory.cpp.

                { mWritten = PR_TRUE; }

Here is the caller graph for this function:

Definition at line 87 of file nsEmbedGlobalHistory.cpp.

                { mLastVisitTime = aTime; }

Member Data Documentation

Definition at line 103 of file nsEmbedGlobalHistory.cpp.

Definition at line 104 of file nsEmbedGlobalHistory.cpp.

nsFixedSizeAllocator * HistoryEntry::sPool [static, private]

Definition at line 107 of file nsEmbedGlobalHistory.cpp.


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