nsISupports* frameState; rv = statefulFrame->SaveState(aPresContext, &frameState);
nsCOMPtr<nsISupports> frameState; rv = statefulFrame->SaveState(aPresContext, getter_AddRefs(frameState));
CaptureFrameStateFor(nsIPresContext* aPresContext, nsIFrame* aFrame, nsILayoutHistoryState* aState){  nsresult rv = NS_OK;  NS_PRECONDITION(nsnull != aFrame && nsnull != aState, "null parameters passed in");  // See if the frame is stateful.  // Frames are not ref-counted so no addref/release is required on statefulFrame.  nsIStatefulFrame* statefulFrame = nsnull;  aFrame->QueryInterface(nsIStatefulFrame::GetIID(), (void**) &statefulFrame);  if (nsnull != statefulFrame) {    // If so, get the content ID, state type and the state and    // add an association between (ID, type) and (state) to the    // history state storage object, aState.    nsCOMPtr<nsIContent> content;        rv = aFrame->GetContent(getter_AddRefs(content));       if (NS_SUCCEEDED(rv)) {      PRUint32 ID;      rv = content->GetContentID(&ID);      if (NS_SUCCEEDED(rv) && ID) { // Must have ID (don't do anonymous content)        nsIStatefulFrame::StateType type = nsIStatefulFrame::eNoType;        rv = statefulFrame->GetStateType(aPresContext, &type);        if (NS_SUCCEEDED(rv)) {          nsISupports* frameState;          rv = statefulFrame->SaveState(aPresContext, &frameState);          if (NS_SUCCEEDED(rv)) {            rv = aState->AddState(ID, frameState, type);          }        }      }    }  }  return rv;}