entry->content = aContent;
FrameManager::SetPrimaryFrameFor(nsIContent* aContent,                                 nsIFrame*   aPrimaryFrame){  NS_ENSURE_TRUE(mPresShell, NS_ERROR_NOT_AVAILABLE);  NS_ENSURE_ARG_POINTER(aContent);  // it's ok if aPrimaryFrame is null  // If aPrimaryFrame is NULL, then remove the mapping  if (!aPrimaryFrame) {    if (mPrimaryFrameMap.ops) {      PL_DHashTableOperate(&mPrimaryFrameMap, aContent, PL_DHASH_REMOVE);    }  } else {#ifdef DEBUG    nsCOMPtr<nsIContent> content;    aPrimaryFrame->GetContent(getter_AddRefs(content));    NS_PRECONDITION(content == aContent, "wrong content");#endif    // Create a new hashtable if necessary    if (!mPrimaryFrameMap.ops) {      if (!PL_DHashTableInit(&mPrimaryFrameMap, &PrimaryFrameMapOps, nsnull,                             sizeof(PrimaryFrameMapEntry), 16)) {        mPrimaryFrameMap.ops = nsnull;        return NS_ERROR_OUT_OF_MEMORY;      }    }    // Add a mapping to the hash table    PrimaryFrameMapEntry *entry = NS_STATIC_CAST(PrimaryFrameMapEntry*,        PL_DHashTableOperate(&mPrimaryFrameMap, aContent, PL_DHASH_ADD));#ifdef DEBUG_dbaron    if (entry->frame) {      NS_WARNING("already have primary frame for content");    }#endif    entry->frame = aPrimaryFrame;  }      return NS_OK;}