Bug 1055427 - Add KillChild() method to nsIMessageManager. r=sicking

Patch originally from bug 1000313.
This commit is contained in:
Ted Clancy (:tedders1) 2014-08-12 08:59:47 -04:00
parent 5089d86b4a
commit 208aa7f675
5 changed files with 28 additions and 1 deletions

View File

@ -405,9 +405,10 @@ interface nsIFrameScriptLoader : nsISupports
jsval getDelayedFrameScripts();
};
[scriptable, builtinclass, uuid(ad57800b-ff21-4e2f-91d3-e68615ae8afe)]
[scriptable, builtinclass, uuid(637e8538-4f8f-4a3d-8510-e74386233e19)]
interface nsIProcessChecker : nsISupports
{
bool killChild();
/**
* Return true if the "remote" process has |aPermission|. This is

View File

@ -803,6 +803,18 @@ nsFrameMessageManager::Atob(const nsAString& aAsciiString,
// nsIProcessChecker
NS_IMETHODIMP
nsFrameMessageManager::KillChild(bool *aValid)
{
if (!mCallback) {
*aValid = false;
return NS_ERROR_NOT_AVAILABLE;
}
*aValid = mCallback->KillChild();
return NS_OK;
}
nsresult
nsFrameMessageManager::AssertProcessInternal(ProcessCheckerType aType,
const nsAString& aCapability,

View File

@ -98,6 +98,12 @@ public:
return false;
}
virtual bool KillChild()
{
// By default, does nothing.
return false;
}
protected:
bool BuildClonedMessageDataForParent(nsIContentParent* aParent,
const StructuredCloneData& aData,

View File

@ -3746,6 +3746,13 @@ ContentParent::CheckAppHasStatus(unsigned short aStatus)
return AssertAppHasStatus(this, aStatus);
}
bool
ContentParent::KillChild()
{
KillHard();
return true;
}
PBlobParent*
ContentParent::SendPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& aParams)

View File

@ -161,6 +161,7 @@ public:
virtual bool CheckManifestURL(const nsAString& aManifestURL) MOZ_OVERRIDE;
virtual bool CheckAppHasPermission(const nsAString& aPermission) MOZ_OVERRIDE;
virtual bool CheckAppHasStatus(unsigned short aStatus) MOZ_OVERRIDE;
virtual bool KillChild() MOZ_OVERRIDE;
/** Notify that a tab is beginning its destruction sequence. */
void NotifyTabDestroying(PBrowserParent* aTab);