nsresult rv; rv = BeginMediaChange(); if (NS_FAILED(rv)) return rv;  rv = Append(aNewMedium); if (NS_FAILED(rv)) return rv;
nsresult result = NS_OK; if (!mMedia) { nsCOMPtr<nsISupportsArray> tmp; result = NS_NewISupportsArray(getter_AddRefs(tmp)); NS_ENSURE_SUCCESS(result, result);
DOMMediaListImpl::AppendMedium(const nsAString& aNewMedium){  nsresult rv;  rv = BeginMediaChange();  if (NS_FAILED(rv))    return rv;    rv = Append(aNewMedium);  if (NS_FAILED(rv))    return rv;  rv = EndMediaChange();  return rv;}