nsCOMPtr<nsIScriptGlobalObject> globalObj; doc->GetScriptGlobalObject(getter_AddRefs(globalObj));  nsCOMPtr<nsIDOMWindow> window (do_QueryInterface(globalObj));
nsCOMPtr<nsIDOMWindow> window (do_QueryInterface(doc->GetScriptGlobalObject()));
nsHTMLFrameElement::GetContentWindow(nsIDOMWindow** aContentWindow){  NS_ENSURE_ARG_POINTER(aContentWindow);  *aContentWindow = nsnull;  nsCOMPtr<nsIDOMDocument> content_doc;  nsresult rv = GetContentDocument(getter_AddRefs(content_doc));  NS_ENSURE_SUCCESS(rv, rv);  nsCOMPtr<nsIDocument> doc(do_QueryInterface(content_doc));  if (!doc) {    return NS_OK;  }  nsCOMPtr<nsIScriptGlobalObject> globalObj;  doc->GetScriptGlobalObject(getter_AddRefs(globalObj));  nsCOMPtr<nsIDOMWindow> window (do_QueryInterface(globalObj));  *aContentWindow = window;  NS_IF_ADDREF(*aContentWindow);  return NS_OK;}