@@ -741,12 +741,9 @@ static WebIDLProcType ProcTypeToWebIDL(mozilla::ProcType aType) {
741
741
742
742
switch (aType) {
743
743
PROCTYPE_TO_WEBIDL_CASE (Web, Web);
744
- PROCTYPE_TO_WEBIDL_CASE (WebIsolated, WebIsolated);
745
744
PROCTYPE_TO_WEBIDL_CASE (File, File);
746
745
PROCTYPE_TO_WEBIDL_CASE (Extension, Extension);
747
746
PROCTYPE_TO_WEBIDL_CASE (PrivilegedAbout, Privilegedabout);
748
- PROCTYPE_TO_WEBIDL_CASE (PrivilegedMozilla, Privilegedmozilla);
749
- PROCTYPE_TO_WEBIDL_CASE (WebCOOPCOEP, WithCoopCoep);
750
747
PROCTYPE_TO_WEBIDL_CASE (WebLargeAllocation, WebLargeAllocation);
751
748
PROCTYPE_TO_WEBIDL_CASE (Browser, Browser);
752
749
PROCTYPE_TO_WEBIDL_CASE (Plugin, Plugin);
@@ -792,7 +789,7 @@ already_AddRefed<Promise> ChromeUtils::RequestProcInfo(GlobalObject& aGlobal,
792
789
global->EventTargetFor (TaskCategory::Performance);
793
790
794
791
// Getting the parent proc info
795
- mozilla::GetProcInfo (parentPid, 0 , mozilla::ProcType::Browser, NS_LITERAL_STRING( " " ) )
792
+ mozilla::GetProcInfo (parentPid, 0 , mozilla::ProcType::Browser)
796
793
->Then (
797
794
target, __func__,
798
795
[target, domPromise, parentPid](ProcInfo aParentInfo) {
@@ -806,7 +803,7 @@ already_AddRefed<Promise> ChromeUtils::RequestProcInfo(GlobalObject& aGlobal,
806
803
if (!aGeckoProcess->GetChildProcessHandle ()) {
807
804
return ;
808
805
}
809
- nsAutoString origin;
806
+
810
807
base::ProcessId childPid =
811
808
base::GetProcId (aGeckoProcess->GetChildProcessHandle ());
812
809
int32_t childId = 0 ;
@@ -826,51 +823,22 @@ already_AddRefed<Promise> ChromeUtils::RequestProcInfo(GlobalObject& aGlobal,
826
823
if (!contentParent) {
827
824
return ;
828
825
}
829
- // Converting the remoteType into a ProcType.
830
- // Ideally, the remoteType should be strongly typed
831
- // upstream, this would make the conversion less brittle.
832
- nsAutoString remoteType (contentParent->GetRemoteType ());
833
- if (StringBeginsWith (
834
- remoteType,
835
- NS_LITERAL_STRING (FISSION_WEB_REMOTE_TYPE))) {
836
- // WARNING: Do not change the order, as
837
- // `DEFAULT_REMOTE_TYPE` is a prefix of
838
- // `FISSION_WEB_REMOTE_TYPE`.
839
- type = mozilla::ProcType::WebIsolated;
840
- } else if (StringBeginsWith (
841
- remoteType,
842
- NS_LITERAL_STRING (DEFAULT_REMOTE_TYPE))) {
826
+ // Converting the Content Type into a ProcType
827
+ nsAutoString processType;
828
+ processType.Assign (contentParent->GetRemoteType ());
829
+ if (IsWebRemoteType (processType)) {
843
830
type = mozilla::ProcType::Web;
844
- } else if (remoteType .EqualsLiteral (FILE_REMOTE_TYPE)) {
831
+ } else if (processType .EqualsLiteral (FILE_REMOTE_TYPE)) {
845
832
type = mozilla::ProcType::File;
846
- } else if (remoteType .EqualsLiteral (
833
+ } else if (processType .EqualsLiteral (
847
834
EXTENSION_REMOTE_TYPE)) {
848
835
type = mozilla::ProcType::Extension;
849
- } else if (remoteType .EqualsLiteral (
836
+ } else if (processType .EqualsLiteral (
850
837
PRIVILEGEDABOUT_REMOTE_TYPE)) {
851
838
type = mozilla::ProcType::PrivilegedAbout;
852
- } else if (remoteType.EqualsLiteral (
853
- PRIVILEGEDMOZILLA_REMOTE_TYPE)) {
854
- type = mozilla::ProcType::PrivilegedMozilla;
855
- } else if (StringBeginsWith (
856
- remoteType,
857
- NS_LITERAL_STRING (
858
- WITH_COOP_COEP_REMOTE_TYPE_PREFIX))) {
859
- type = mozilla::ProcType::WebCOOPCOEP;
860
- } else if (remoteType.EqualsLiteral (
839
+ } else if (processType.EqualsLiteral (
861
840
LARGE_ALLOCATION_REMOTE_TYPE)) {
862
841
type = mozilla::ProcType::WebLargeAllocation;
863
- } else {
864
- MOZ_CRASH (" Unknown remoteType" );
865
- }
866
-
867
- // By convention, everything after '=' is the origin.
868
- nsAString::const_iterator cursor;
869
- nsAString::const_iterator end;
870
- remoteType.BeginReading (cursor);
871
- remoteType.EndReading (end);
872
- if (FindCharInReadable (u' =' , cursor, end)) {
873
- origin = Substring (++cursor, end);
874
842
}
875
843
childId = contentParent->ChildID ();
876
844
break ;
@@ -911,10 +879,10 @@ already_AddRefed<Promise> ChromeUtils::RequestProcInfo(GlobalObject& aGlobal,
911
879
912
880
promises.AppendElement (
913
881
#ifdef XP_MACOSX
914
- mozilla::GetProcInfo (childPid, childId, type, origin,
882
+ mozilla::GetProcInfo (childPid, childId, type,
915
883
aGeckoProcess->GetChildTask ())
916
884
#else
917
- mozilla::GetProcInfo (childPid, childId, type, origin )
885
+ mozilla::GetProcInfo (childPid, childId, type)
918
886
#endif
919
887
);
920
888
});
@@ -960,7 +928,6 @@ already_AddRefed<Promise> ChromeUtils::RequestProcInfo(GlobalObject& aGlobal,
960
928
// Basic info.
961
929
childProcInfo->mChildID = info.childId ;
962
930
childProcInfo->mType = ProcTypeToWebIDL (info.type );
963
- childProcInfo->mOrigin = info.origin ;
964
931
childProcInfo->mPid = info.pid ;
965
932
childProcInfo->mFilename .Assign (info.filename );
966
933
childProcInfo->mVirtualMemorySize = info.virtualMemorySize ;
0 commit comments