Bug 1193903 - Improve error reporting for out-of-process saveBrowser(). r=mconley

This commit is contained in:
Jed Davis 2015-08-13 18:08:02 -07:00
parent aa46626cb8
commit 94306e555a

View File

@ -137,13 +137,15 @@ function saveBrowser(aBrowser, aSkipPrompt)
let persistable = aBrowser.QueryInterface(Ci.nsIFrameLoaderOwner)
.frameLoader
.QueryInterface(Ci.nsIWebBrowserPersistable);
let stack = Components.stack.caller;
persistable.startPersistence({
onDocumentReady: function (document) {
saveDocument(document, aSkipPrompt);
},
onError: function (status) {
throw new Components.Exception("saveBrowser failed asynchronously in startPersistence",
status, stack);
}
// This interface also has an |onError| method which takes an
// nsresult, but in case of asynchronous failure there isn't
// really anything useful that can be done here.
});
}
@ -153,8 +155,7 @@ function saveBrowser(aBrowser, aSkipPrompt)
// aDocument can also be a CPOW for a remote nsIDOMDocument, in which
// case "save as" modes that serialize the document's DOM are
// unavailable. This is a temporary measure for the "Save Frame As"
// command (bug 1141337), and it's possible that there could be
// add-ons doing something similar.
// command (bug 1141337) and pre-e10s add-ons.
function saveDocument(aDocument, aSkipPrompt)
{
const Ci = Components.interfaces;