Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsStaticAtom.h File Reference
#include "nsIAtom.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  nsStaticAtom


NS_COM nsresult NS_RegisterStaticAtoms (const nsStaticAtom *, PRUint32 aAtomCount)

Class Documentation

struct nsStaticAtom

Definition at line 54 of file nsStaticAtom.h.

Collaboration diagram for nsStaticAtom:
Class Members
nsIAtom ** mAtom
const char * mString

Function Documentation

Definition at line 509 of file nsAtomTable.cpp.

  // this does two things:
  // 1) wraps each static atom in a wrapper, if necessary
  // 2) initializes the address pointed to by each mAtom slot
  for (PRUint32 i=0; i<aAtomCount; i++) {
                 "Static atoms must be ASCII!");
    AtomTableEntry *he =
    if (he->HasValue() && aAtoms[i].mAtom) {
      // there already is an atom with this name in the table.. but we
      // still have to update mAtom
      if (!he->IsStaticAtom() && !he->GetAtomImpl()->IsPermanent()) {
        // since we wanted to create a static atom but there is
        // already one there, we convert it to a non-refcounting
        // permanent atom
      // and now, if the consumer wants to remember this value in a
      // slot, we do so
      if (aAtoms[i].mAtom)
        *aAtoms[i].mAtom = he->GetAtom();
    else {
      nsStaticAtomWrapper* atom = WrapStaticAtom(&aAtoms[i]);
      NS_ASSERTION(atom, "Failed to wrap static atom");

      // but even if atom is null, no real difference in code..
      if (aAtoms[i].mAtom)
        *aAtoms[i].mAtom = atom;
  return NS_OK;

Here is the call graph for this function:

Here is the caller graph for this function: