NS_ASSERTION(aSizeOfHandler, "SizeOfHandler cannot be null in SizeOf");
NS_ASSERTION(aSizeOfHandler != nsnull, "SizeOf handler cannot be null");  static PRBool bDetailDumpDone = PR_FALSE; if (!bDetailDumpDone) { bDetailDumpDone = PR_TRUE; PRUint32 totalSize=0;  printf( "Detailed StyleContextImpl dump: basic class sizes of members\n" ); printf( "*************************************\n"); printf( " - StyleFontImpl:          %ld\n", (long)sizeof(GETSCDATA(Font)) ); totalSize += (long)sizeof(GETSCDATA(Font)); printf( " - StyleColorImpl:         %ld\n", (long)sizeof(GETSCDATA(Color)) ); totalSize += (long)sizeof(GETSCDATA(Color)); printf( " - StyleSpacingImpl:       %ld\n", (long)sizeof(GETSCDATA(Spacing)) ); totalSize += (long)sizeof(GETSCDATA(Spacing)); printf( " - StyleListImpl:          %ld\n", (long)sizeof(GETSCDATA(List)) ); totalSize += (long)sizeof(GETSCDATA(List)); printf( " - StylePositionImpl:      %ld\n", (long)sizeof(GETSCDATA(Position)) ); totalSize += (long)sizeof(GETSCDATA(Position)); printf( " - StyleTextImpl:          %ld\n", (long)sizeof(GETSCDATA(Text)) ); totalSize += (long)sizeof(GETSCDATA(Text)); printf( " - StyleDisplayImpl:       %ld\n", (long)sizeof(GETSCDATA(Display)) ); totalSize += (long)sizeof(GETSCDATA(Display)); printf( " - StyleTableImpl:         %ld\n", (long)sizeof(GETSCDATA(Table)) ); totalSize += (long)sizeof(GETSCDATA(Table)); printf( " - StyleContentImpl:       %ld\n", (long)sizeof(GETSCDATA(Content)) ); totalSize += (long)sizeof(GETSCDATA(Content)); printf( " - StyleUserInterfaceImpl: %ld\n", (long)sizeof(GETSCDATA(UserInterface)) ); totalSize += (long)sizeof(GETSCDATA(UserInterface)); printf( " - StylePrintImpl:         %ld\n", (long)sizeof(GETSCDATA(Print))); totalSize += (long)sizeof(GETSCDATA(Print)); printf( " - Total:                  %ld\n", (long)totalSize); printf( "*************************************\n"); }
void nsStyleContextData::SizeOf(nsISizeOfHandler *aSizeOfHandler, PRUint32 &aSize){  NS_ASSERTION(aSizeOfHandler, "SizeOfHandler cannot be null in SizeOf");  // first get the unique items collection  UNIQUE_STYLE_ITEMS(uniqueItems);  if(! uniqueItems->AddItem((void*)this) ){    // object has already been accounted for    return;  }  // get or create a tag for this instance  nsCOMPtr<nsIAtom> tag;  tag = getter_AddRefs(NS_NewAtom("StyleContextData"));  // get the size of an empty instance and add to the sizeof handler  aSize = sizeof(*this);  aSizeOfHandler->AddSize(tag,aSize);}