mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 02:25:34 +00:00
Bug 1599616 - Don't try to save document when document actor has been destroyed. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D94733
This commit is contained in:
parent
23aba1fe38
commit
1e4c7e1c01
@ -79,6 +79,12 @@ WebBrowserPersistLocalDocument::GetPersistFlags(uint32_t* aFlags) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebBrowserPersistLocalDocument::GetIsClosed(bool* aIsClosed) {
|
||||
*aIsClosed = false;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebBrowserPersistLocalDocument::GetIsPrivate(bool* aIsPrivate) {
|
||||
nsCOMPtr<nsILoadContext> privacyContext = mDocument->GetLoadContext();
|
||||
|
@ -41,6 +41,12 @@ WebBrowserPersistRemoteDocument::~WebBrowserPersistRemoteDocument() {
|
||||
|
||||
void WebBrowserPersistRemoteDocument::ActorDestroy(void) { mActor = nullptr; }
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebBrowserPersistRemoteDocument::GetIsClosed(bool* aIsClosed) {
|
||||
*aIsClosed = !mActor;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebBrowserPersistRemoteDocument::GetIsPrivate(bool* aIsPrivate) {
|
||||
*aIsPrivate = mAttrs.isPrivate();
|
||||
|
@ -59,6 +59,7 @@ interface nsIWebBrowserPersistURIMap : nsISupports
|
||||
[scriptable, builtinclass, uuid(74aa4918-5d15-46b6-9ccf-74f9696d721d)]
|
||||
interface nsIWebBrowserPersistDocument : nsISupports
|
||||
{
|
||||
readonly attribute boolean isClosed;
|
||||
readonly attribute boolean isPrivate;
|
||||
readonly attribute AUTF8String documentURI;
|
||||
readonly attribute AUTF8String baseURI;
|
||||
|
@ -508,10 +508,13 @@ NS_IMETHODIMP nsWebBrowserPersist::SaveDocument(nsISupports* aDocument,
|
||||
rv = NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
}
|
||||
if (doc) {
|
||||
|
||||
bool closed = false;
|
||||
if (doc && NS_SUCCEEDED(doc->GetIsClosed(&closed)) && !closed) {
|
||||
rv = SaveDocumentInternal(doc, fileAsURI, datapathAsURI);
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
|
||||
if (NS_FAILED(rv) || closed) {
|
||||
SendErrorStatusChange(true, rv, nullptr, mURI);
|
||||
EndDownload(rv);
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
[browser_bug1204626.js]
|
||||
fail-if = fission && !debug
|
||||
skip-if = fission && os == 'linux' && debug
|
||||
support-files =
|
||||
bug1204626_doc0.html
|
||||
bug1204626_doc1.html
|
||||
|
Loading…
Reference in New Issue
Block a user