Bug 1649686 - Test whether webCOOP+COEP is a prefix before testing whether web is a prefix;r=Yoric
authorBruno Bartolomasi <brunobrt@hotmail.com>
Wed, 22 Jul 2020 09:38:49 +0000
changeset 541574 e1013eb60a84d0cc2d931fbc0bb8b27684c22db5
parent 541573 6f3bea644fbef273492e8480804413fe99e5b2da
child 541578 ab972fb40873261901a725d28c24b75e8750c8ae
push id122343
push userdteller@mozilla.com
push dateWed, 22 Jul 2020 09:40:33 +0000
treeherderautoland@e1013eb60a84 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1649686
milestone80.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 1649686 - Test whether webCOOP+COEP is a prefix before testing whether web is a prefix;r=Yoric Differential Revision: https://phabricator.services.mozilla.com/D83386
dom/base/ChromeUtils.cpp
--- a/dom/base/ChromeUtils.cpp
+++ b/dom/base/ChromeUtils.cpp
@@ -844,32 +844,33 @@ already_AddRefed<Promise> ChromeUtils::R
               return;
             }
             // Converting the remoteType into a ProcType.
             // Ideally, the remoteType should be strongly typed
             // upstream, this would make the conversion less brittle.
             nsAutoCString remoteType(contentParent->GetRemoteType());
             if (StringBeginsWith(remoteType, FISSION_WEB_REMOTE_TYPE)) {
               // WARNING: Do not change the order, as
-              // `DEFAULT_REMOTE_TYPE` is a prefix of
-              // `FISSION_WEB_REMOTE_TYPE`.
+              // `DEFAULT_REMOTE_TYPE` is a prefix of both
+              // 'FISSION_WEB_REMOTE_TYPE' and
+              // `WITH_COOP_COEP_REMOTE_TYPE_PREFIX`.
               type = mozilla::ProcType::WebIsolated;
+            } else if (StringBeginsWith(remoteType,
+                                        WITH_COOP_COEP_REMOTE_TYPE_PREFIX)) {
+              type = mozilla::ProcType::WebCOOPCOEP;
             } else if (StringBeginsWith(remoteType, DEFAULT_REMOTE_TYPE)) {
               type = mozilla::ProcType::Web;
             } else if (remoteType == FILE_REMOTE_TYPE) {
               type = mozilla::ProcType::File;
             } else if (remoteType == EXTENSION_REMOTE_TYPE) {
               type = mozilla::ProcType::Extension;
             } else if (remoteType == PRIVILEGEDABOUT_REMOTE_TYPE) {
               type = mozilla::ProcType::PrivilegedAbout;
             } else if (remoteType == PRIVILEGEDMOZILLA_REMOTE_TYPE) {
               type = mozilla::ProcType::PrivilegedMozilla;
-            } else if (StringBeginsWith(remoteType,
-                                        WITH_COOP_COEP_REMOTE_TYPE_PREFIX)) {
-              type = mozilla::ProcType::WebCOOPCOEP;
             } else if (remoteType == LARGE_ALLOCATION_REMOTE_TYPE) {
               type = mozilla::ProcType::WebLargeAllocation;
             } else if (remoteType == PREALLOC_REMOTE_TYPE) {
               type = mozilla::ProcType::Preallocated;
             } else {
               MOZ_CRASH_UNSAFE_PRINTF("Unknown remoteType '%s'",
                                       remoteType.get());
             }