Bug 1264811 - Use a const reference and a default constructor to simplify the macOS sandbox code; r=haik

MozReview-Commit-ID: Dtspj7fL9t7

--HG--
extra : rebase_source : 4b85a1d7bd8ad393f032e67ebff0888bcfdd5447
This commit is contained in:
Alex Gaynor 2017-07-28 15:00:22 -04:00
Родитель 5c9899d993
Коммит 724ff5d5bc
2 изменённых файлов: 4 добавлений и 14 удалений

Просмотреть файл

@ -41,18 +41,8 @@ typedef struct _MacSandboxInfo {
_MacSandboxInfo()
: type(MacSandboxType_Default), level(0), hasFilePrivileges(false),
shouldLog(true) {}
_MacSandboxInfo(const struct _MacSandboxInfo& other)
: type(other.type), level(other.level),
hasFilePrivileges(other.hasFilePrivileges),
hasSandboxedProfile(other.hasSandboxedProfile),
pluginInfo(other.pluginInfo),
appPath(other.appPath), appBinaryPath(other.appBinaryPath),
appDir(other.appDir), appTempDir(other.appTempDir),
profileDir(other.profileDir), debugWriteDir(other.debugWriteDir),
testingReadPath1(other.testingReadPath1),
testingReadPath2(other.testingReadPath2),
testingReadPath3(other.testingReadPath3),
testingReadPath4(other.testingReadPath4), shouldLog(other.shouldLog) {}
_MacSandboxInfo(const struct _MacSandboxInfo& other) = default;
MacSandboxType type;
int32_t level;
bool hasFilePrivileges;
@ -75,7 +65,7 @@ typedef struct _MacSandboxInfo {
namespace mozilla {
bool StartMacSandbox(MacSandboxInfo aInfo, std::string &aErrorMessage);
bool StartMacSandbox(MacSandboxInfo const &aInfo, std::string &aErrorMessage);
} // namespace mozilla

Просмотреть файл

@ -124,7 +124,7 @@ OSXVersion::GetVersionNumber()
namespace mozilla {
bool StartMacSandbox(MacSandboxInfo aInfo, std::string &aErrorMessage)
bool StartMacSandbox(MacSandboxInfo const &aInfo, std::string &aErrorMessage)
{
std::vector<const char *> params;
char *profile = NULL;