зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1325255 - Don't crash during shutdown if the deserialization of the principal fails; r=bkelly
This commit is contained in:
Родитель
7702c68f7a
Коммит
41b2cc8dd4
|
@ -4800,7 +4800,8 @@ ContentParent::RecvPURLClassifierConstructor(PURLClassifierParent* aActor,
|
|||
auto* actor = static_cast<URLClassifierParent*>(aActor);
|
||||
nsCOMPtr<nsIPrincipal> principal(aPrincipal);
|
||||
if (!principal) {
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
actor->ClassificationFailed();
|
||||
return IPC_OK();
|
||||
}
|
||||
return actor->StartClassify(principal, aUseTrackingProtection, aSuccess);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ URLClassifierParent::StartClassify(nsIPrincipal* aPrincipal,
|
|||
// without ever calling out callback in both cases.
|
||||
// This means that code using this in the child process will only get a hit
|
||||
// on its callback if some classification actually happens.
|
||||
Unused << Send__delete__(this, void_t());
|
||||
ClassificationFailed();
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
@ -48,6 +48,14 @@ URLClassifierParent::OnClassifyComplete(nsresult aRv)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
URLClassifierParent::ClassificationFailed()
|
||||
{
|
||||
if (mIPCOpen) {
|
||||
Unused << Send__delete__(this, void_t());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
URLClassifierParent::ActorDestroy(ActorDestroyReason aWhy)
|
||||
{
|
||||
|
|
|
@ -27,6 +27,8 @@ class URLClassifierParent : public nsIURIClassifierCallback,
|
|||
bool* aSuccess);
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
|
||||
void ClassificationFailed();
|
||||
|
||||
private:
|
||||
~URLClassifierParent() = default;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче