diff --git a/dom/ipc/AppProcessChecker.cpp b/dom/ipc/AppProcessChecker.cpp index 5b9f890ad29..a3c2b6e72b2 100644 --- a/dom/ipc/AppProcessChecker.cpp +++ b/dom/ipc/AppProcessChecker.cpp @@ -14,6 +14,7 @@ #include "nsIAppsService.h" #include "nsIPrincipal.h" #include "nsIScriptSecurityManager.h" +#include "nsPrintfCString.h" #include "nsIURI.h" #include "nsNetUtil.h" #include "nsServiceManagerUtils.h" @@ -115,7 +116,11 @@ AssertAppProcess(PContentParent* aActor, } } - printf_stderr("Security problem: Content process does not have `%s'. It will be killed.\n", aCapability); + NS_ERROR( + nsPrintfCString( + "Security problem: Content process does not have `%s'. It will be killed.\n", + aCapability).get()); + static_cast(aActor)->KillHard(); return false; @@ -133,7 +138,11 @@ AssertAppStatus(PContentParent* aActor, } } - printf_stderr("Security problem: Content process does not have `%d' status. It will be killed.\n", aStatus); + NS_ERROR( + nsPrintfCString( + "Security problem: Content process does not have `%d' status. It will be killed.", + aStatus).get()); + static_cast(aActor)->KillHard(); return false; diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 4ae5486dd9f..eea759a8f3a 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -1984,8 +1984,11 @@ ContentParent::RecvNuwaReady() { #ifdef MOZ_NUWA_PROCESS if (!IsNuwaProcess()) { - printf_stderr("Terminating child process %d for unauthorized IPC message: " - "NuwaReady", Pid()); + NS_ERROR( + nsPrintfCString( + "Terminating child process %d for unauthorized IPC message: NuwaReady", + Pid()).get()); + KillHard(); return false; } @@ -2003,8 +2006,11 @@ ContentParent::RecvAddNewProcess(const uint32_t& aPid, { #ifdef MOZ_NUWA_PROCESS if (!IsNuwaProcess()) { - printf_stderr("Terminating child process %d for unauthorized IPC message: " - "AddNewProcess(%d)", Pid(), aPid); + NS_ERROR( + nsPrintfCString( + "Terminating child process %d for unauthorized IPC message: " + "AddNewProcess(%d)", Pid(), aPid).get()); + KillHard(); return false; }