2014-08-08 20:55:22 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_Sandbox_h
|
|
|
|
#define mozilla_Sandbox_h
|
|
|
|
|
2015-04-03 19:51:41 +03:00
|
|
|
#include <string>
|
2014-08-08 20:55:22 +04:00
|
|
|
|
|
|
|
enum MacSandboxType {
|
|
|
|
MacSandboxType_Default = 0,
|
|
|
|
MacSandboxType_Plugin,
|
2014-10-30 21:33:17 +03:00
|
|
|
MacSandboxType_Content,
|
2014-08-08 20:55:22 +04:00
|
|
|
MacSandboxType_Invalid
|
|
|
|
};
|
|
|
|
|
|
|
|
enum MacSandboxPluginType {
|
|
|
|
MacSandboxPluginType_Default = 0,
|
2016-05-02 20:33:08 +03:00
|
|
|
MacSandboxPluginType_GMPlugin_Default, // Any Gecko Media Plugin
|
|
|
|
MacSandboxPluginType_GMPlugin_OpenH264, // Gecko Media Plugin, OpenH264
|
|
|
|
MacSandboxPluginType_GMPlugin_EME, // Gecko Media Plugin, EME
|
|
|
|
MacSandboxPluginType_GMPlugin_EME_Widevine, // Gecko Media Plugin, Widevine
|
2014-08-08 20:55:22 +04:00
|
|
|
MacSandboxPluginType_Invalid
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _MacSandboxPluginInfo {
|
|
|
|
_MacSandboxPluginInfo()
|
|
|
|
: type(MacSandboxPluginType_Default) {}
|
2015-04-03 19:51:41 +03:00
|
|
|
_MacSandboxPluginInfo(const struct _MacSandboxPluginInfo& other)
|
|
|
|
: type(other.type), pluginPath(other.pluginPath),
|
|
|
|
pluginBinaryPath(other.pluginBinaryPath) {}
|
2014-08-08 20:55:22 +04:00
|
|
|
MacSandboxPluginType type;
|
2015-04-03 19:51:41 +03:00
|
|
|
std::string pluginPath;
|
|
|
|
std::string pluginBinaryPath;
|
2014-08-08 20:55:22 +04:00
|
|
|
} MacSandboxPluginInfo;
|
|
|
|
|
|
|
|
typedef struct _MacSandboxInfo {
|
|
|
|
_MacSandboxInfo()
|
2017-01-18 02:47:13 +03:00
|
|
|
: type(MacSandboxType_Default), level(0), shouldLog(true) {}
|
2015-04-03 19:51:41 +03:00
|
|
|
_MacSandboxInfo(const struct _MacSandboxInfo& other)
|
2016-08-30 23:32:21 +03:00
|
|
|
: type(other.type), level(other.level),
|
|
|
|
hasSandboxedProfile(other.hasSandboxedProfile),
|
|
|
|
pluginInfo(other.pluginInfo),
|
2015-04-03 19:51:41 +03:00
|
|
|
appPath(other.appPath), appBinaryPath(other.appBinaryPath),
|
2016-08-30 23:32:21 +03:00
|
|
|
appDir(other.appDir), appTempDir(other.appTempDir),
|
2017-01-18 02:47:13 +03:00
|
|
|
profileDir(other.profileDir), shouldLog(other.shouldLog) {}
|
2014-08-08 20:55:22 +04:00
|
|
|
MacSandboxType type;
|
2015-04-03 19:51:41 +03:00
|
|
|
int32_t level;
|
2016-08-30 23:32:21 +03:00
|
|
|
bool hasSandboxedProfile;
|
2014-08-08 20:55:22 +04:00
|
|
|
MacSandboxPluginInfo pluginInfo;
|
2015-04-03 19:51:41 +03:00
|
|
|
std::string appPath;
|
|
|
|
std::string appBinaryPath;
|
|
|
|
std::string appDir;
|
2016-02-26 02:26:13 +03:00
|
|
|
std::string appTempDir;
|
2016-08-30 23:32:21 +03:00
|
|
|
std::string profileDir;
|
2017-01-18 02:47:13 +03:00
|
|
|
bool shouldLog;
|
2014-08-08 20:55:22 +04:00
|
|
|
} MacSandboxInfo;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2015-04-03 19:51:41 +03:00
|
|
|
bool StartMacSandbox(MacSandboxInfo aInfo, std::string &aErrorMessage);
|
2014-08-08 20:55:22 +04:00
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_Sandbox_h
|