mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 918880 - Followup - gracefully recover from scheduleUpdate() failure r=fabrice
This commit is contained in:
parent
1b076c9518
commit
6a17879fd1
@ -1559,8 +1559,12 @@ TabParent::AllocPOfflineCacheUpdateParent(const URIParams& aManifestURI,
|
||||
IsBrowserElement());
|
||||
|
||||
nsresult rv = update->Schedule(aManifestURI, aDocumentURI, stickDocument);
|
||||
if (NS_FAILED(rv))
|
||||
return nullptr;
|
||||
if (NS_FAILED(rv)) {
|
||||
// Must dispatch since the parent is not at this moment ready yet.
|
||||
nsRefPtr<nsRunnableMethod<mozilla::docshell::OfflineCacheUpdateParent> > event =
|
||||
NS_NewRunnableMethod(update, &mozilla::docshell::OfflineCacheUpdateParent::Kill);
|
||||
NS_DispatchToCurrentThread(event);
|
||||
}
|
||||
|
||||
POfflineCacheUpdateParent* result = update.get();
|
||||
update.forget();
|
||||
|
@ -141,6 +141,12 @@ OfflineCacheUpdateParent::Schedule(const URIParams& aManifestURI,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
OfflineCacheUpdateParent::Kill()
|
||||
{
|
||||
unused << SendFinish(false, false);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
OfflineCacheUpdateParent::UpdateStateChanged(nsIOfflineCacheUpdate *aUpdate, uint32_t state)
|
||||
{
|
||||
|
@ -40,6 +40,8 @@ public:
|
||||
const URIParams& documentURI,
|
||||
const bool& stickDocument);
|
||||
|
||||
void Kill();
|
||||
|
||||
OfflineCacheUpdateParent(uint32_t aAppId, bool aIsInBrowser);
|
||||
~OfflineCacheUpdateParent();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user