nsCOMPtr<nsIContentViewer> viewer; mDocShell->GetContentViewer(getter_AddRefs(viewer));
mWebShell->GetContentViewer(getter_AddRefs(viewer));
NS_IMETHODIMP nsMessenger::DoPrint(){#ifdef DEBUG_MESSENGER  printf("nsMessenger::DoPrint()\n");#endif  nsresult rv = NS_ERROR_FAILURE;  NS_ENSURE_TRUE(mDocShell, NS_ERROR_FAILURE);  nsCOMPtr<nsIContentViewer> viewer;  mDocShell->GetContentViewer(getter_AddRefs(viewer));  if (viewer)   {    nsCOMPtr<nsIContentViewerFile> viewerFile = do_QueryInterface(viewer);    if (viewerFile) {      rv = viewerFile->Print(PR_FALSE,nsnull);    }#ifdef DEBUG_MESSENGER    else {	    printf("the content viewer does not support printing\n");    }#endif  }#ifdef DEBUG_MESSENGER  else {	printf("failed to get the viewer for printing\n");  }#endif    return rv;}