This source file includes following definitions.
- InitializeSandbox
#include "content/public/common/sandbox_init.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "content/common/sandbox_win.h"
#include "content/public/common/content_switches.h"
#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/sandbox_types.h"
namespace content {
bool InitializeSandbox(sandbox::SandboxInterfaceInfo* sandbox_info) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
sandbox::BrokerServices* broker_services = sandbox_info->broker_services;
if (broker_services) {
if (!InitBrokerServices(broker_services))
return false;
if (!command_line.HasSwitch(switches::kNoSandbox)) {
bool use_winsta = !command_line.HasSwitch(
switches::kDisableAltWinstation);
sandbox::TargetPolicy* policy = broker_services->CreatePolicy();
sandbox::ResultCode result = policy->CreateAlternateDesktop(use_winsta);
CHECK(sandbox::SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION != result);
policy->Release();
}
return true;
}
if (command_line.HasSwitch(switches::kNoSandbox))
return true;
sandbox::TargetServices* target_services = sandbox_info->target_services;
return InitTargetServices(target_services);
}
}