Attachment #9118943: patch for bug #1531475

View | Details | Raw Unified | Return to bug 1531475
Collapse All | Expand All

(-)a/ipc/glue/GeckoChildProcessHost.cpp (+4 lines)
Line     Link Here 
 Lines 1117-1147   bool PosixProcessLauncher::DoSetup() { Link Here 
1117
1117
1118
  if (pathType == BinPathType::Self) {
1118
  if (pathType == BinPathType::Self) {
1119
    mChildArgv.push_back("-contentproc");
1119
    mChildArgv.push_back("-contentproc");
1120
  }
1120
  }
1121
1121
1122
  mChildArgv.insert(mChildArgv.end(), mExtraOpts.begin(), mExtraOpts.end());
1122
  mChildArgv.insert(mChildArgv.end(), mExtraOpts.begin(), mExtraOpts.end());
1123
1123
1124
  if (mProcessType != GeckoProcessType_GMPlugin) {
1124
  if (mProcessType != GeckoProcessType_GMPlugin) {
1125
#if defined(MOZ_WIDGET_ANDROID)
1125
    if (Omnijar::IsInitialized()) {
1126
    if (Omnijar::IsInitialized()) {
1126
      // Make sure that child processes can find the omnijar
1127
      // Make sure that child processes can find the omnijar
1127
      // See XRE_InitCommandLine in nsAppRunner.cpp
1128
      // See XRE_InitCommandLine in nsAppRunner.cpp
1128
      nsAutoCString path;
1129
      nsAutoCString path;
1129
      nsCOMPtr<nsIFile> file = Omnijar::GetPath(Omnijar::GRE);
1130
      nsCOMPtr<nsIFile> file = Omnijar::GetPath(Omnijar::GRE);
1130
      if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
1131
      if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
1131
        mChildArgv.push_back("-greomni");
1132
        mChildArgv.push_back("-greomni");
1132
        mChildArgv.push_back(path.get());
1133
        mChildArgv.push_back(path.get());
1133
      }
1134
      }
1134
      file = Omnijar::GetPath(Omnijar::APP);
1135
      file = Omnijar::GetPath(Omnijar::APP);
1135
      if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
1136
      if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
1136
        mChildArgv.push_back("-appomni");
1137
        mChildArgv.push_back("-appomni");
1137
        mChildArgv.push_back(path.get());
1138
        mChildArgv.push_back(path.get());
1138
      }
1139
      }
1139
    }
1140
    }
1141
#endif
1140
    // Add the application directory path (-appdir path)
1142
    // Add the application directory path (-appdir path)
1141
#  ifdef XP_MACOSX
1143
#  ifdef XP_MACOSX
1142
    AddAppDirToCommandLine(mChildArgv, mAppDir, mProfileDir);
1144
    AddAppDirToCommandLine(mChildArgv, mAppDir, mProfileDir);
1143
#  else
1145
#  else
1144
    AddAppDirToCommandLine(mChildArgv, mAppDir, nullptr);
1146
    AddAppDirToCommandLine(mChildArgv, mAppDir, nullptr);
1145
#  endif
1147
#  endif
1146
  }
1148
  }
1147
1149
 Lines 1333-1363   bool WindowsProcessLauncher::DoSetup() { Link Here 
1333
1335
1334
  mCmdLine->AppendSwitchWithValue(switches::kProcessChannelID, mChannelId);
1336
  mCmdLine->AppendSwitchWithValue(switches::kProcessChannelID, mChannelId);
1335
1337
1336
  for (std::vector<std::string>::iterator it = mExtraOpts.begin();
1338
  for (std::vector<std::string>::iterator it = mExtraOpts.begin();
1337
       it != mExtraOpts.end(); ++it) {
1339
       it != mExtraOpts.end(); ++it) {
1338
    mCmdLine->AppendLooseValue(UTF8ToWide(*it));
1340
    mCmdLine->AppendLooseValue(UTF8ToWide(*it));
1339
  }
1341
  }
1340
1342
1343
#if defined(MOZ_WIDGET_ANDROID)
1341
  if (Omnijar::IsInitialized()) {
1344
  if (Omnijar::IsInitialized()) {
1342
    // Make sure the child process can find the omnijar
1345
    // Make sure the child process can find the omnijar
1343
    // See XRE_InitCommandLine in nsAppRunner.cpp
1346
    // See XRE_InitCommandLine in nsAppRunner.cpp
1344
    nsAutoString path;
1347
    nsAutoString path;
1345
    nsCOMPtr<nsIFile> file = Omnijar::GetPath(Omnijar::GRE);
1348
    nsCOMPtr<nsIFile> file = Omnijar::GetPath(Omnijar::GRE);
1346
    if (file && NS_SUCCEEDED(file->GetPath(path))) {
1349
    if (file && NS_SUCCEEDED(file->GetPath(path))) {
1347
      mCmdLine->AppendLooseValue(UTF8ToWide("-greomni"));
1350
      mCmdLine->AppendLooseValue(UTF8ToWide("-greomni"));
1348
      mCmdLine->AppendLooseValue(path.get());
1351
      mCmdLine->AppendLooseValue(path.get());
1349
    }
1352
    }
1350
    file = Omnijar::GetPath(Omnijar::APP);
1353
    file = Omnijar::GetPath(Omnijar::APP);
1351
    if (file && NS_SUCCEEDED(file->GetPath(path))) {
1354
    if (file && NS_SUCCEEDED(file->GetPath(path))) {
1352
      mCmdLine->AppendLooseValue(UTF8ToWide("-appomni"));
1355
      mCmdLine->AppendLooseValue(UTF8ToWide("-appomni"));
1353
      mCmdLine->AppendLooseValue(path.get());
1356
      mCmdLine->AppendLooseValue(path.get());
1354
    }
1357
    }
1355
  }
1358
  }
1359
#endif
1356
1360
1357
#  if defined(MOZ_SANDBOX)
1361
#  if defined(MOZ_SANDBOX)
1358
#    if defined(_ARM64_)
1362
#    if defined(_ARM64_)
1359
  if (isClearKey || isWidevine)
1363
  if (isClearKey || isWidevine)
1360
    mResults.mSandboxBroker = new RemoteSandboxBroker();
1364
    mResults.mSandboxBroker = new RemoteSandboxBroker();
1361
  else
1365
  else
1362
#    endif  // if defined(_ARM64_)
1366
#    endif  // if defined(_ARM64_)
1363
    mResults.mSandboxBroker = new SandboxBroker();
1367
    mResults.mSandboxBroker = new SandboxBroker();
(-)a/toolkit/xre/nsAppRunner.cpp (+3 lines)
Line     Link Here 
 Lines 4851-4866   nsresult XRE_InitCommandLine(int aArgc, Link Here 
4851
  CommandLine::Init(aArgc, canonArgs);
4851
  CommandLine::Init(aArgc, canonArgs);
4852
4852
4853
  for (int i = 0; i < aArgc; ++i) free(canonArgs[i]);
4853
  for (int i = 0; i < aArgc; ++i) free(canonArgs[i]);
4854
  delete[] canonArgs;
4854
  delete[] canonArgs;
4855
#endif
4855
#endif
4856
4856
4857
  recordreplay::parent::InitializeUIProcess(gArgc, gArgv);
4857
  recordreplay::parent::InitializeUIProcess(gArgc, gArgv);
4858
4858
4859
#if defined(MOZ_WIDGET_ANDROID)
4859
  const char* path = nullptr;
4860
  const char* path = nullptr;
4860
  ArgResult ar = CheckArg("greomni", &path);
4861
  ArgResult ar = CheckArg("greomni", &path);
4861
  if (ar == ARG_BAD) {
4862
  if (ar == ARG_BAD) {
4862
    PR_fprintf(PR_STDERR,
4863
    PR_fprintf(PR_STDERR,
4863
               "Error: argument --greomni requires a path argument\n");
4864
               "Error: argument --greomni requires a path argument\n");
4864
    return NS_ERROR_FAILURE;
4865
    return NS_ERROR_FAILURE;
4865
  }
4866
  }
4866
4867
 Lines 4886-4901   nsresult XRE_InitCommandLine(int aArgc, Link Here 
4886
    if (NS_FAILED(rv)) {
4887
    if (NS_FAILED(rv)) {
4887
      PR_fprintf(PR_STDERR,
4888
      PR_fprintf(PR_STDERR,
4888
                 "Error: argument --appomni requires a valid path\n");
4889
                 "Error: argument --appomni requires a valid path\n");
4889
      return rv;
4890
      return rv;
4890
    }
4891
    }
4891
  }
4892
  }
4892
4893
4893
  mozilla::Omnijar::Init(greOmni, appOmni);
4894
  mozilla::Omnijar::Init(greOmni, appOmni);
4895
#endif
4896
4894
  return rv;
4897
  return rv;
4895
}
4898
}
4896
4899
4897
nsresult XRE_DeinitCommandLine() {
4900
nsresult XRE_DeinitCommandLine() {
4898
  nsresult rv = NS_OK;
4901
  nsresult rv = NS_OK;
4899
4902
4900
  CommandLine::Terminate();
4903
  CommandLine::Terminate();
4901
4904

Return to bug 1531475