bool GMPChild::SetMacSandboxInfo() { if (!mGMPLoader) { return false; } nsAutoCString pluginDirectoryPath, pluginFilePath; if (!GetPluginPaths(mPluginPath, pluginDirectoryPath, pluginFilePath)) { return false; } nsAutoCString appPath, appBinaryPath; if (!GetAppPaths(appPath, appBinaryPath)) { return false; } MacSandboxInfo info; info.type = MacSandboxType_Plugin; info.pluginInfo.type = MacSandboxPluginType_GMPlugin_Default; info.pluginInfo.pluginPath.assign(pluginDirectoryPath.get()); info.pluginInfo.pluginBinaryPath.assign(pluginFilePath.get()); info.appPath.assign(appPath.get()); info.appBinaryPath.assign(appBinaryPath.get()); mGMPLoader->SetSandboxInfo(&info); return true; }
bool GMPChild::SetMacSandboxInfo(MacSandboxPluginType aPluginType) { if (!mGMPLoader) { return false; } nsAutoCString pluginDirectoryPath, pluginFilePath; if (!GetPluginPaths(mPluginPath, pluginDirectoryPath, pluginFilePath)) { return false; } nsAutoCString appPath, appBinaryPath; if (!GetAppPaths(appPath, appBinaryPath)) { return false; } MacSandboxInfo info; info.type = MacSandboxType_Plugin; info.shouldLog = Preferences::GetBool("security.sandbox.logging.enabled") || PR_GetEnv("MOZ_SANDBOX_LOGGING"); info.pluginInfo.type = aPluginType; info.pluginInfo.pluginPath.assign(pluginDirectoryPath.get()); info.pluginInfo.pluginBinaryPath.assign(pluginFilePath.get()); info.appPath.assign(appPath.get()); info.appBinaryPath.assign(appBinaryPath.get()); mGMPLoader->SetSandboxInfo(&info); return true; }
// // Checks to see if Cygwin is initalized, and prompts user to do it if not. // Returns true if Cygwin is initialized, otherwise false. // bool eDocumentPath::InitCygwin(const bool silent) { if (eDocumentPath::s_isCygwinInitialized) return true; // Check if we have a cygwin installation and read out configuration eDocumentPath::s_cygPath = eDocumentPath::GetCygwinDir(); eDocumentPath::s_cygdrivePrefix = eDocumentPath::GetCygdrivePrefix(); const bool cygwin_is_installed = !s_cygPath.empty(); if (!cygwin_is_installed) { if (!silent) run_cygwin_dlg(wxTheApp->GetTopWindow(), cxCYGWIN_INSTALL); return false; } // Get last cygwin update, and see if we need to reinstall const wxString supportPath = GetAppPaths().AppPath() + wxT("support\\bin\\cygwin-post-install.sh"); const wxFileName supportFile(supportPath); wxDateTime stampTime = get_last_cygwin_update(); if (eDocumentPath_shouldUpdateCygwin(stampTime, supportFile)) { if (!silent) { run_cygwin_dlg(wxTheApp->GetTopWindow(), cxCYGWIN_UPDATE); // Cancel the command that needed cygwin support (return false below.) // But, since we have an older version of Cygwin installed, // claim that we have been initialized anyway. // // The user may retry the command, and it will work assuming it doesn't // rely on new Cygwin behavior. eDocumentPath::s_isCygwinInitialized = true; } return false; } eDocumentPath::s_isCygwinInitialized = true; return true; }