Bug 821044 - Add MOZ_DEBUG_APP_PROCESS support r=cjones
authorKan-Ru Chen (陳侃如) <kanru@kanru.info>
Thu, 13 Dec 2012 12:30:44 +1300
changeset 115860 8bfd7767182cb494e06744d4821ccfc4e734729c
parent 115859 652e6b974c13d84f6c933728029d2b99929d7e73
child 115861 9e155b2cc8c37c07a79b5ee7e4ed14ceed7ebc9c
push id24028
push useremorley@mozilla.com
push dateThu, 13 Dec 2012 15:56:02 +0000
treeherderautoland@9db79b97abbb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs821044
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 821044 - Add MOZ_DEBUG_APP_PROCESS support r=cjones
dom/ipc/ContentChild.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -300,16 +300,28 @@ ContentChild::Init(MessageLoop* aIOLoop,
     }
 
     return true;
 }
 
 void
 ContentChild::SetProcessName(const nsAString& aName)
 {
+    char* name;
+    if ((name = PR_GetEnv("MOZ_DEBUG_APP_PROCESS")) &&
+        aName.EqualsASCII(name)) {
+#ifdef OS_POSIX
+        printf_stderr("\n\nCHILDCHILDCHILDCHILD\n  [%s] debug me @%d\n\n", name, getpid());
+        sleep(30);
+#elif defined(OS_WIN)
+        printf_stderr("\n\nCHILDCHILDCHILDCHILD\n  [%s] debug me @%d\n\n", name, _getpid());
+        Sleep(30000);
+#endif
+    }
+
     mProcessName = aName;
     mozilla::ipc::SetThisProcessName(NS_LossyConvertUTF16toASCII(aName).get());
 }
 
 const void
 ContentChild::GetProcessName(nsAString& aName)
 {
     aName.Assign(mProcessName);