return nsDocShell::Embed(aContentViewer, aCommand, aExtraInfo);
nsresult rv; nsRect bounds;  WEB_TRACE(WEB_TRACE_CALLS, ("nsWebShell::Embed: this=%p aDocViewer=%p aCommand=%s aExtraInfo=%p", this, aContentViewer, aCommand ? aCommand : "", aExtraInfo));               nsCOMPtr<nsIWebShell> parent; rv = GetParent(*getter_AddRefs(parent)); if (NS_FAILED(rv)) { return rv; }  if (mContentViewer || parent) { nsCOMPtr<nsIMarkupDocumentViewer> oldMUDV; if (mContentViewer) {   oldMUDV = do_QueryInterface(mContentViewer); } else { nsCOMPtr<nsIContentViewer> parentContentViewer; rv = parent->GetContentViewer(getter_AddRefs(parentContentViewer)); if (NS_FAILED(rv)) { return rv; } if (parentContentViewer) { oldMUDV = do_QueryInterface(parentContentViewer); } }  PRUnichar *defaultCharset=nsnull; PRUnichar *forceCharset=nsnull; PRUnichar *hintCharset=nsnull; PRInt32 hintCharsetSource;  nsCOMPtr<nsIMarkupDocumentViewer> newMUDV = do_QueryInterface(aContentViewer); if (oldMUDV && newMUDV) { NS_ENSURE_SUCCESS(oldMUDV->GetDefaultCharacterSet (&defaultCharset), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(oldMUDV->GetForceCharacterSet (&forceCharset), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(oldMUDV->GetHintCharacterSet (&hintCharset), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(oldMUDV->GetHintCharacterSetSource (&hintCharsetSource), NS_ERROR_FAILURE);   NS_ENSURE_SUCCESS(newMUDV->SetDefaultCharacterSet (defaultCharset), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(newMUDV->SetForceCharacterSet (forceCharset), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(newMUDV->SetHintCharacterSet (hintCharset), NS_ERROR_FAILURE); NS_ENSURE_SUCCESS(newMUDV->SetHintCharacterSetSource (hintCharsetSource), NS_ERROR_FAILURE);  if (defaultCharset) { Recycle(defaultCharset); } if (forceCharset) { Recycle(forceCharset); } if (hintCharset) { Recycle(hintCharset); } } }   mContentViewer = nsnull; if (mScriptContext) { mScriptContext->GC(); } mContentViewer = aContentViewer;    if(mWindow && mWindow->GetNativeData(NS_NATIVE_WIDGET)) { mWindow->GetClientBounds(bounds); bounds.x = bounds.y = 0; rv = mContentViewer->Init(mWindow->GetNativeData(NS_NATIVE_WIDGET), mDeviceContext, mPrefs, bounds, mScrollPref);     if (mContentViewer && mHistoryState) { nsCOMPtr<nsIDocumentViewer> docv = do_QueryInterface(mContentViewer); if (nsnull != docv) { nsCOMPtr<nsIPresShell> shell; rv = docv->GetPresShell(*getter_AddRefs(shell)); if (NS_SUCCEEDED(rv)) { rv = shell->SetHistoryState((nsILayoutHistoryState*) mHistoryState); } } }  if (NS_SUCCEEDED(rv)) { mContentViewer->Show(); } } else { mContentViewer = nsnull; }   DestroyChildren();  return rv;
nsWebShell::Embed(nsIContentViewer* aContentViewer,                  const char* aCommand,                  nsISupports* aExtraInfo){	return nsDocShell::Embed(aContentViewer, aCommand, aExtraInfo);}