mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1598787 - Rename XRE_ChildProcessTypeToString to XRE_GeckoProcessTypeToString. r=froydnj
This function works on all GeckoProcessTypes, not just those for child processes. Differential Revision: https://phabricator.services.mozilla.com/D54375 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
b7e760c953
commit
d25c3b20ae
@ -43,7 +43,7 @@ void MMPrinter::PrintImpl(char const* aLocation, const nsAString& aMsg,
|
||||
|
||||
MOZ_LOG(MMPrinter::sMMLog, LogLevel::Debug,
|
||||
("%s Message: %s in process type: %s", aLocation, charMsg.get(),
|
||||
XRE_ChildProcessTypeToString(XRE_GetProcessType())));
|
||||
XRE_GeckoProcessTypeToString(XRE_GetProcessType())));
|
||||
|
||||
if (!MOZ_LOG_TEST(sMMLog, LogLevel::Verbose)) {
|
||||
return;
|
||||
@ -76,4 +76,4 @@ void MMPrinter::PrintImpl(char const* aLocation, const nsAString& aMsg,
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
} // namespace mozilla
|
||||
|
@ -233,7 +233,7 @@ void GPUChild::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
|
||||
Telemetry::Accumulate(
|
||||
Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
||||
nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_GPU)),
|
||||
nsDependentCString(XRE_GeckoProcessTypeToString(GeckoProcessType_GPU)),
|
||||
1);
|
||||
|
||||
// Notify the Telemetry environment so that we can refresh and do a
|
||||
|
@ -94,7 +94,7 @@ void VRChild::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
|
||||
Telemetry::Accumulate(
|
||||
Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
||||
nsDependentCString(XRE_ChildProcessTypeToString(GeckoProcessType_VR)),
|
||||
nsDependentCString(XRE_GeckoProcessTypeToString(GeckoProcessType_VR)),
|
||||
1);
|
||||
}
|
||||
gfxVars::RemoveReceiver(this);
|
||||
|
@ -179,7 +179,7 @@ class BaseProcessLauncher {
|
||||
void GetChildLogName(const char* origLogName, nsACString& buffer);
|
||||
|
||||
const char* ChildProcessType() {
|
||||
return XRE_ChildProcessTypeToString(mProcessType);
|
||||
return XRE_GeckoProcessTypeToString(mProcessType);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISerialEventTarget> mLaunchThread;
|
||||
@ -680,10 +680,10 @@ bool GeckoChildProcessHost::AsyncLaunch(std::vector<std::string> aExtraOpts) {
|
||||
// If something failed let's set the error state and notify.
|
||||
CHROMIUM_LOG(ERROR)
|
||||
<< "Failed to launch "
|
||||
<< XRE_ChildProcessTypeToString(mProcessType) << " subprocess";
|
||||
<< XRE_GeckoProcessTypeToString(mProcessType) << " subprocess";
|
||||
Telemetry::Accumulate(
|
||||
Telemetry::SUBPROCESS_LAUNCH_FAILURE,
|
||||
nsDependentCString(XRE_ChildProcessTypeToString(mProcessType)));
|
||||
nsDependentCString(XRE_GeckoProcessTypeToString(mProcessType)));
|
||||
{
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
mProcessState = PROCESS_ERROR;
|
||||
|
@ -92,7 +92,7 @@ void StreamSamplesAndMarkers(const char* aName, int aThreadId,
|
||||
double aSinceTime, UniqueStacks& aUniqueStacks) {
|
||||
aWriter.StringProperty(
|
||||
"processType",
|
||||
"(unknown)" /* XRE_ChildProcessTypeToString(XRE_GetProcessType()) */);
|
||||
"(unknown)" /* XRE_GeckoProcessTypeToString(XRE_GetProcessType()) */);
|
||||
|
||||
aWriter.StringProperty("name", aName);
|
||||
|
||||
|
@ -60,7 +60,7 @@ bool RemoteSandboxBrokerParent::DuplicateFromLauncher(HANDLE aLauncherHandle,
|
||||
void RemoteSandboxBrokerParent::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
if (AbnormalShutdown == aWhy) {
|
||||
Telemetry::Accumulate(Telemetry::SUBPROCESS_ABNORMAL_ABORT,
|
||||
nsDependentCString(XRE_ChildProcessTypeToString(
|
||||
nsDependentCString(XRE_GeckoProcessTypeToString(
|
||||
GeckoProcessType_RemoteSandboxBroker)),
|
||||
1);
|
||||
GenerateCrashReport(OtherPid());
|
||||
|
@ -258,7 +258,7 @@ bool SandboxBroker::LaunchApp(const wchar_t* aPath, const wchar_t* aArguments,
|
||||
&last_warning, &last_error, &targetInfo);
|
||||
if (sandbox::SBOX_ALL_OK != result) {
|
||||
nsAutoCString key;
|
||||
key.AppendASCII(XRE_ChildProcessTypeToString(aProcessType));
|
||||
key.AppendASCII(XRE_GeckoProcessTypeToString(aProcessType));
|
||||
key.AppendLiteral("/0x");
|
||||
key.AppendInt(static_cast<uint32_t>(last_error), 16);
|
||||
|
||||
|
@ -127,7 +127,7 @@ def process_leak_log(leak_log_file, leak_thresholds=None,
|
||||
The base of leak_log_file for a non-default process needs to end with
|
||||
_proctype_pid12345.log
|
||||
"proctype" is a string denoting the type of the process, which should
|
||||
be the result of calling XRE_ChildProcessTypeToString(). 12345 is
|
||||
be the result of calling XRE_GeckoProcessTypeToString(). 12345 is
|
||||
a series of digits that is the pid for the process. The .log is
|
||||
optional.
|
||||
|
||||
|
@ -504,7 +504,7 @@ void BackgroundHangThread::ReportHang(TimeDuration aHangTime,
|
||||
|
||||
HangDetails hangDetails(
|
||||
aHangTime,
|
||||
nsDependentCString(XRE_ChildProcessTypeToString(XRE_GetProcessType())),
|
||||
nsDependentCString(XRE_GeckoProcessTypeToString(XRE_GetProcessType())),
|
||||
VoidString(), mThreadName, mRunnableName, std::move(mHangStack),
|
||||
std::move(mAnnotations));
|
||||
|
||||
|
@ -302,7 +302,7 @@ static nsresult GetPerProcObject(JSContext* aCx, const IndexMap& aModuleIndices,
|
||||
if (aData.mProcessType == GeckoProcessType_Default) {
|
||||
strProcType.Rebind(NS_LITERAL_CSTRING("browser"), 0);
|
||||
} else {
|
||||
strProcType.Rebind(XRE_ChildProcessTypeToString(aData.mProcessType));
|
||||
strProcType.Rebind(XRE_GeckoProcessTypeToString(aData.mProcessType));
|
||||
}
|
||||
|
||||
JS::RootedValue jsProcType(aCx);
|
||||
|
@ -179,7 +179,7 @@ void RunWatchdog(void* arg) {
|
||||
continue;
|
||||
}
|
||||
|
||||
NoteIntentionalCrash(XRE_ChildProcessTypeToString(XRE_GetProcessType()));
|
||||
NoteIntentionalCrash(XRE_GeckoProcessTypeToString(XRE_GetProcessType()));
|
||||
|
||||
// The shutdown steps are not completed yet. Let's report the last one.
|
||||
if (!sShutdownNotified) {
|
||||
|
@ -224,7 +224,7 @@ void XRE_TermEmbedding() {
|
||||
delete gDirServiceProvider;
|
||||
}
|
||||
|
||||
const char* XRE_ChildProcessTypeToString(GeckoProcessType aProcessType) {
|
||||
const char* XRE_GeckoProcessTypeToString(GeckoProcessType aProcessType) {
|
||||
return (aProcessType < GeckoProcessType_End)
|
||||
? kGeckoProcessTypeString[aProcessType]
|
||||
: "invalid";
|
||||
@ -241,7 +241,7 @@ const char* XRE_ChildProcessTypeToAnnotation(GeckoProcessType aProcessType) {
|
||||
case GeckoProcessType_Content:
|
||||
return "content";
|
||||
default:
|
||||
return XRE_ChildProcessTypeToString(aProcessType);
|
||||
return XRE_GeckoProcessTypeToString(aProcessType);
|
||||
}
|
||||
}
|
||||
|
||||
@ -582,7 +582,7 @@ nsresult XRE_InitChildProcess(int aArgc, char* aArgv[],
|
||||
# endif
|
||||
printf_stderr(
|
||||
"\n\nCHILDCHILDCHILDCHILD (process type %s)\n debug me @ %d\n\n",
|
||||
XRE_ChildProcessTypeToString(XRE_GetProcessType()),
|
||||
XRE_GeckoProcessTypeToString(XRE_GetProcessType()),
|
||||
base::GetCurrentProcId());
|
||||
sleep(GetDebugChildPauseTime());
|
||||
}
|
||||
@ -594,7 +594,7 @@ nsresult XRE_InitChildProcess(int aArgc, char* aArgv[],
|
||||
} else if (PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
|
||||
printf_stderr(
|
||||
"\n\nCHILDCHILDCHILDCHILD (process type %s)\n debug me @ %d\n\n",
|
||||
XRE_ChildProcessTypeToString(XRE_GetProcessType()),
|
||||
XRE_GeckoProcessTypeToString(XRE_GetProcessType()),
|
||||
base::GetCurrentProcId());
|
||||
::Sleep(GetDebugChildPauseTime());
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ Faulty::Faulty()
|
||||
mIsValidProcessType(IsValidProcessType()) {
|
||||
if (mIsValidProcessType) {
|
||||
FAULTY_LOG("Initializing for new process of type '%s' with pid %u.",
|
||||
XRE_ChildProcessTypeToString(XRE_GetProcessType()), getpid());
|
||||
XRE_GeckoProcessTypeToString(XRE_GetProcessType()), getpid());
|
||||
|
||||
/* Setup random seed. */
|
||||
const char* userSeed = PR_GetEnv("FAULTY_SEED");
|
||||
@ -230,7 +230,7 @@ bool Faulty::IsValidProcessType(void) {
|
||||
|
||||
if (!isValidProcessType) {
|
||||
FAULTY_LOG("Disabled for this process of type '%s' with pid %d.",
|
||||
XRE_ChildProcessTypeToString(XRE_GetProcessType()), getpid());
|
||||
XRE_GeckoProcessTypeToString(XRE_GetProcessType()), getpid());
|
||||
}
|
||||
|
||||
return isValidProcessType;
|
||||
|
@ -207,7 +207,7 @@ void StreamSamplesAndMarkers(const char* aName, int aThreadId,
|
||||
const mozilla::TimeStamp& aUnregisterTime,
|
||||
double aSinceTime, UniqueStacks& aUniqueStacks) {
|
||||
aWriter.StringProperty("processType",
|
||||
XRE_ChildProcessTypeToString(XRE_GetProcessType()));
|
||||
XRE_GeckoProcessTypeToString(XRE_GetProcessType()));
|
||||
|
||||
aWriter.StringProperty("name", aName);
|
||||
|
||||
|
@ -438,7 +438,7 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr,
|
||||
}
|
||||
|
||||
static void Abort(const char* aMsg) {
|
||||
NoteIntentionalCrash(XRE_ChildProcessTypeToString(XRE_GetProcessType()));
|
||||
NoteIntentionalCrash(XRE_GeckoProcessTypeToString(XRE_GetProcessType()));
|
||||
mozalloc_abort(aMsg);
|
||||
}
|
||||
|
||||
|
@ -249,7 +249,7 @@ class BloatEntry {
|
||||
|
||||
bool PrintDumpHeader(FILE* aOut, const char* aMsg) {
|
||||
fprintf(aOut, "\n== BloatView: %s, %s process %d\n", aMsg,
|
||||
XRE_ChildProcessTypeToString(XRE_GetProcessType()), getpid());
|
||||
XRE_GeckoProcessTypeToString(XRE_GetProcessType()), getpid());
|
||||
if (gLogLeaksOnly && !mStats.HaveLeaks()) {
|
||||
return false;
|
||||
}
|
||||
@ -507,7 +507,7 @@ static bool InitLog(const EnvCharType* aEnvVar, const char* aMsg,
|
||||
}
|
||||
fname.Append('_');
|
||||
const char* processType =
|
||||
XRE_ChildProcessTypeToString(XRE_GetProcessType());
|
||||
XRE_GeckoProcessTypeToString(XRE_GetProcessType());
|
||||
fname.AppendASCII(processType);
|
||||
fname.AppendLiteral("_pid");
|
||||
fname.AppendInt((uint32_t)getpid());
|
||||
@ -827,7 +827,7 @@ static void LogDMDFile() {
|
||||
}
|
||||
|
||||
const char* logProcessEnv = PR_GetEnv("MOZ_DMD_LOG_PROCESS");
|
||||
if (logProcessEnv && !!strcmp(logProcessEnv, XRE_ChildProcessTypeToString(
|
||||
if (logProcessEnv && !!strcmp(logProcessEnv, XRE_GeckoProcessTypeToString(
|
||||
XRE_GetProcessType()))) {
|
||||
return;
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ static const char* const kGeckoProcessTypeString[] = {
|
||||
static_assert(MOZ_ARRAY_LENGTH(kGeckoProcessTypeString) == GeckoProcessType_End,
|
||||
"Array length mismatch");
|
||||
|
||||
XRE_API(const char*, XRE_ChildProcessTypeToString,
|
||||
XRE_API(const char*, XRE_GeckoProcessTypeToString,
|
||||
(GeckoProcessType aProcessType))
|
||||
XRE_API(const char*, XRE_ChildProcessTypeToAnnotation,
|
||||
(GeckoProcessType aProcessType))
|
||||
|
Loading…
Reference in New Issue
Block a user