macOS: Add support for and enable the V2 sandbox (issue #2459)

The CEF_USE_SANDBOX define is now used on all platforms.
This commit is contained in:
Marshall Greenblatt
2018-07-27 17:28:12 -04:00
parent fcad76b405
commit dec98a5534
25 changed files with 461 additions and 108 deletions

View File

@@ -9,19 +9,15 @@
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "base/strings/sys_string_conversions.h"
namespace util_mac {
namespace {
// Returns the path to the top-level app bundle that contains the main process
// executable.
base::FilePath GetMainBundlePath() {
return base::mac::GetAppBundlePath(GetMainProcessPath());
}
// Returns the path to the Frameworks directory inside the top-level app bundle.
base::FilePath GetFrameworksPath() {
base::FilePath bundle_path = GetMainBundlePath();
@@ -68,6 +64,15 @@ base::FilePath GetMainProcessPath() {
return path;
}
base::FilePath GetMainBundlePath() {
return base::mac::GetAppBundlePath(GetMainProcessPath());
}
std::string GetMainBundleID() {
NSBundle* bundle = base::mac::OuterBundle();
return base::SysNSStringToUTF8([bundle bundleIdentifier]);
}
base::FilePath GetMainResourcesDirectory() {
base::FilePath bundle_path = GetMainBundlePath();
if (bundle_path.empty())