1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 
5 package org.mozilla.gecko.process;
6 
7 import org.mozilla.gecko.annotation.WrapForJNI;
8 
9 @WrapForJNI
10 public enum GeckoProcessType {
11     // These need to match the stringified names from the GeckoProcessType enum
12     PARENT ("default"),
13     PLUGIN ("plugin"),
14     CONTENT ("tab"),
15     IPDLUNITTEST ("ipdlunittest"),
16     GMPLUGIN ("gmplugin"),
17     GPU ("gpu"),
18     VR ("vr"),
19     RDD ("rdd"),
20     SOCKET ("socket"),
21     REMOTESANDBOXBROKER ("sandboxbroker"),
22     FORKSERVER ("forkserver");
23 
24     private final String mGeckoName;
25 
GeckoProcessType(final String geckoName)26     private GeckoProcessType(final String geckoName) {
27         mGeckoName = geckoName;
28     }
29 
30     @Override
toString()31     public String toString() {
32         return mGeckoName;
33     }
34 
35     @WrapForJNI
fromInt(final int type)36     private static final GeckoProcessType fromInt(final int type) {
37         return values()[type];
38     }
39 }
40 
41