Bug 1470591 - Part 1: Add a new process type for ForkServer. r=gsvelto draft
authorThinker <thinker.li@gmail.com>
Fri, 22 Nov 2019 22:09:16 -0800
changeset 2497063 ed2141abd9f2d3922347d0e0e9e67bd397eea444
parent 2493346 2c912e46295e4f8a3fa5824a7f378e06760ec7dd
child 2497064 c26c3b7da49ff583fc441ed934a2fe75fda5ecca
push id455563
push userthinker.li@gmail.com
push dateTue, 26 Nov 2019 06:43:52 +0000
treeherdertry@60c1683c97b6 [default view] [failures only]
reviewersgsvelto
bugs1470591
milestone72.0a1
Bug 1470591 - Part 1: Add a new process type for ForkServer. r=gsvelto
ipc/glue/CrashReporterHost.cpp
toolkit/components/crashes/nsICrashService.idl
toolkit/xre/nsAppRunner.cpp
xpcom/build/GeckoProcessTypes.h
xpcom/system/nsIXULRuntime.idl
--- a/ipc/glue/CrashReporterHost.cpp
+++ b/ipc/glue/CrashReporterHost.cpp
@@ -42,19 +42,22 @@ static_assert(nsICrashService::PROCESS_T
 static_assert(nsICrashService::PROCESS_TYPE_RDD == (int)GeckoProcessType_RDD,
               "GeckoProcessType enum is out of sync with nsICrashService!");
 static_assert(nsICrashService::PROCESS_TYPE_SOCKET ==
                   (int)GeckoProcessType_Socket,
               "GeckoProcessType enum is out of sync with nsICrashService!");
 static_assert(nsICrashService::PROCESS_TYPE_SANDBOX_BROKER ==
                   (int)GeckoProcessType_RemoteSandboxBroker,
               "GeckoProcessType enum is out of sync with nsICrashService!");
+static_assert(nsICrashService::PROCESS_TYPE_FORKSERVER ==
+                  (int)GeckoProcessType_ForkServer,
+              "GeckoProcessType enum is out of sync with nsICrashService!");
 // Add new static asserts here if you add more process types.
 // Update this static assert as well.
-static_assert(nsICrashService::PROCESS_TYPE_SANDBOX_BROKER + 1 ==
+static_assert(nsICrashService::PROCESS_TYPE_FORKSERVER + 1 ==
                   (int)GeckoProcessType_End,
               "GeckoProcessType enum is out of sync with nsICrashService!");
 
 namespace mozilla {
 namespace ipc {
 
 CrashReporterHost::CrashReporterHost(GeckoProcessType aProcessType,
                                      const Shmem& aShmem,
--- a/toolkit/components/crashes/nsICrashService.idl
+++ b/toolkit/components/crashes/nsICrashService.idl
@@ -26,13 +26,14 @@ interface nsICrashService : nsISupports
   const long PROCESS_TYPE_CONTENT = 2;
   const long PROCESS_TYPE_IPDLUNITTEST = 3;
   const long PROCESS_TYPE_GMPLUGIN = 4;
   const long PROCESS_TYPE_GPU = 5;
   const long PROCESS_TYPE_VR = 6;
   const long PROCESS_TYPE_RDD = 7;
   const long PROCESS_TYPE_SOCKET = 8;
   const long PROCESS_TYPE_SANDBOX_BROKER = 9;
+  const long PROCESS_TYPE_FORKSERVER = 10;
   // New process types should be added at the end of the above list.
 
   const long CRASH_TYPE_CRASH = 0;
   const long CRASH_TYPE_HANG = 1;
 };
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -635,19 +635,20 @@ SYNC_ENUMS(PLUGIN, Plugin)
 SYNC_ENUMS(CONTENT, Content)
 SYNC_ENUMS(IPDLUNITTEST, IPDLUnitTest)
 SYNC_ENUMS(GMPLUGIN, GMPlugin)
 SYNC_ENUMS(GPU, GPU)
 SYNC_ENUMS(VR, VR)
 SYNC_ENUMS(RDD, RDD)
 SYNC_ENUMS(SOCKET, Socket)
 SYNC_ENUMS(SANDBOX_BROKER, RemoteSandboxBroker)
+SYNC_ENUMS(FORKSERVER, ForkServer)
 
 // .. and ensure that that is all of them:
-static_assert(GeckoProcessType_RemoteSandboxBroker + 1 == GeckoProcessType_End,
+static_assert(GeckoProcessType_ForkServer + 1 == GeckoProcessType_End,
               "Did not find the final GeckoProcessType");
 
 NS_IMETHODIMP
 nsXULAppInfo::GetProcessType(uint32_t* aResult) {
   NS_ENSURE_ARG_POINTER(aResult);
   *aResult = XRE_GetProcessType();
   return NS_OK;
 }
--- a/xpcom/build/GeckoProcessTypes.h
+++ b/xpcom/build/GeckoProcessTypes.h
@@ -33,8 +33,9 @@ GECKO_PROCESS_TYPE(GPU, "gpu", GPU, Self
 // VR process.
 GECKO_PROCESS_TYPE(VR, "vr", VR, Self)
 // Remote Data Decoder process.
 GECKO_PROCESS_TYPE(RDD, "rdd", RDD, Self)
 // Socket process
 GECKO_PROCESS_TYPE(Socket, "socket", Socket, Self)
 GECKO_PROCESS_TYPE(RemoteSandboxBroker, "sandboxbroker", RemoteSandboxBroker,
                    PluginContainer)
+GECKO_PROCESS_TYPE(ForkServer, "forkserver", ForkServer, Self)
--- a/xpcom/system/nsIXULRuntime.idl
+++ b/xpcom/system/nsIXULRuntime.idl
@@ -75,16 +75,17 @@ interface nsIXULRuntime : nsISupports
   const unsigned long PROCESS_TYPE_CONTENT = 2;
   const unsigned long PROCESS_TYPE_IPDLUNITTEST = 3;
   const unsigned long PROCESS_TYPE_GMPLUGIN = 4;
   const unsigned long PROCESS_TYPE_GPU = 5;
   const unsigned long PROCESS_TYPE_VR = 6;
   const unsigned long PROCESS_TYPE_RDD = 7;
   const unsigned long PROCESS_TYPE_SOCKET = 8;
   const unsigned long PROCESS_TYPE_SANDBOX_BROKER = 9;
+  const unsigned long PROCESS_TYPE_FORKSERVER = 10;
 
   /**
    * The type of the caller's process.  Returns one of the values above.
    */
   readonly attribute unsigned long processType;
 
   /**
    * The system process ID of the caller's process.