Bug 1326245: Tell the child processes when we're in safe mode. r=smaug
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 08 Feb 2017 15:45:01 -0800
changeset 481544 20a0d5bdd1c2dcea83a827f72f12ad85f0804a0c
parent 481543 f8cdec1f5a8b34e52a79a8022891df2dde3058a9
child 481545 8f3cd4a6678b20b535538581351be15f95a597cc
push id44840
push userbmo:rchien@mozilla.com
push dateFri, 10 Feb 2017 01:03:57 +0000
reviewerssmaug
bugs1326245
milestone54.0a1
Bug 1326245: Tell the child processes when we're in safe mode. r=smaug MozReview-Commit-ID: EiuULIb5L6A
dom/ipc/ContentParent.cpp
dom/ipc/ContentProcess.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -1865,16 +1865,20 @@ ContentParent::LaunchSubprocess(ProcessP
 
   extraArgs.push_back("-intPrefs");
   extraArgs.push_back(intPrefs.str());
   extraArgs.push_back("-boolPrefs");
   extraArgs.push_back(boolPrefs.str());
   extraArgs.push_back("-stringPrefs");
   extraArgs.push_back(stringPrefs.str());
 
+  if (gSafeMode) {
+    extraArgs.push_back("-safeMode");
+  }
+
   if (!mSubprocess->LaunchAndWaitForProcessHandle(extraArgs)) {
     MarkAsDead();
     return false;
   }
 
   Open(mSubprocess->GetChannel(),
      base::GetProcId(mSubprocess->GetChildProcessHandle()));
 
--- a/dom/ipc/ContentProcess.cpp
+++ b/dom/ipc/ContentProcess.cpp
@@ -192,16 +192,19 @@ ContentProcess::Init(int aArgc, char* aA
         MaybePrefValue value(PrefValue(nsCString(str, length)));
         PrefSetting pref(nsCString(ContentPrefs::GetContentPref(index)), value, MaybePrefValue());
         prefsArray.AppendElement(pref);
         str += length + 1;
       }
       SET_PREF_PHASE(END_INIT_PREFS);
       foundStringPrefs = true;
     }
+    else if (!strcmp(aArgv[idx], "-safeMode")) {
+      gSafeMode = true;
+    }
 
 #if defined(XP_MACOSX) && defined(MOZ_CONTENT_SANDBOX)
     else if (!strcmp(aArgv[idx], "-profile")) {
       MOZ_ASSERT(!foundProfile);
       if (foundProfile) {
         continue;
       }
       bool flag;