Bug 1217190 - Make PrintingParent return an nsresult when attempting to show print progress. r=bobowen

--HG--
extra : commitid : LH8E3YSVlSd
extra : rebase_source : a48a93195c576648f4a46c9eb60756186684e0eb
extra : histedit_source : f582237e3e58d92a1ec38a4b2a82d77bae620d48
This commit is contained in:
Mike Conley 2015-10-26 16:47:48 -04:00
Родитель b3b7658208
Коммит 11408875de
4 изменённых файлов: 15 добавлений и 14 удалений

Просмотреть файл

@ -23,7 +23,7 @@ parent:
PPrintProgressDialog printProgressDialog,
bool isForPrinting)
returns(bool notifyOnOpen,
bool success);
nsresult rv);
async ShowPrintDialog(PPrintSettingsDialog dialog,
PBrowser browser,

Просмотреть файл

@ -30,9 +30,9 @@ PrintingParent::RecvShowProgress(PBrowserParent* parent,
PPrintProgressDialogParent* printProgressDialog,
const bool& isForPrinting,
bool* notifyOnOpen,
bool* success)
nsresult* result)
{
*success = false;
*result = NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMWindow> parentWin = DOMWindowFromBrowserParent(parent);
if (!parentWin) {
@ -52,17 +52,16 @@ PrintingParent::RecvShowProgress(PBrowserParent* parent,
nsCOMPtr<nsIWebProgressListener> printProgressListener;
nsCOMPtr<nsIPrintProgressParams> printProgressParams;
nsresult rv = pps->ShowProgress(parentWin, nullptr, nullptr, observer,
isForPrinting,
getter_AddRefs(printProgressListener),
getter_AddRefs(printProgressParams),
notifyOnOpen);
NS_ENSURE_SUCCESS(rv, true);
*result = pps->ShowProgress(parentWin, nullptr, nullptr, observer,
isForPrinting,
getter_AddRefs(printProgressListener),
getter_AddRefs(printProgressParams),
notifyOnOpen);
NS_ENSURE_SUCCESS(*result, true);
dialogParent->SetWebProgressListener(printProgressListener);
dialogParent->SetPrintProgressParams(printProgressParams);
*success = true;
return true;
}

Просмотреть файл

@ -25,7 +25,7 @@ public:
PPrintProgressDialogParent* printProgressDialog,
const bool& isForPrinting,
bool* notifyOnOpen,
bool* success);
nsresult* result);
virtual bool
RecvShowPrintDialog(PPrintSettingsDialogParent* aDialog,
PBrowserParent* aParent,

Просмотреть файл

@ -149,10 +149,12 @@ nsPrintingProxy::ShowProgress(nsIDOMWindow* parent,
SendPPrintProgressDialogConstructor(dialogChild);
bool success = false;
mozilla::unused << SendShowProgress(pBrowser, dialogChild,
isForPrinting, notifyOnOpen, &success);
isForPrinting, notifyOnOpen, &rv);
if (NS_FAILED(rv)) {
return rv;
}
NS_ADDREF(*webProgressListener = dialogChild);
NS_ADDREF(*printProgressParams = dialogChild);