| Index: content/common/sandbox_win.cc
|
| diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
|
| index 2cd1e9c32ca8233f51efe021dc44fe59d5124a0f..0c8bf9323a5560e4caf10c7616f7d752f39b550d 100644
|
| --- a/content/common/sandbox_win.cc
|
| +++ b/content/common/sandbox_win.cc
|
| @@ -708,7 +708,8 @@ sandbox::ResultCode StartSandboxedProcess(
|
| return sandbox::SBOX_ALL_OK;
|
| }
|
|
|
| - sandbox::TargetPolicy* policy = g_broker_services->CreatePolicy();
|
| + scoped_refptr<sandbox::TargetPolicy> policy =
|
| + g_broker_services->CreatePolicy();
|
|
|
| // Add any handles to be inherited to the policy.
|
| for (HANDLE handle : handles_to_inherit)
|
| @@ -737,7 +738,7 @@ sandbox::ResultCode StartSandboxedProcess(
|
| #if !defined(NACL_WIN64)
|
| if (type_str == switches::kRendererProcess &&
|
| IsWin32kRendererLockdownEnabled()) {
|
| - result = AddWin32kLockdownPolicy(policy, false);
|
| + result = AddWin32kLockdownPolicy(policy.get(), false);
|
| if (result != sandbox::SBOX_ALL_OK)
|
| return result;
|
| }
|
| @@ -751,12 +752,12 @@ sandbox::ResultCode StartSandboxedProcess(
|
| if (result != sandbox::SBOX_ALL_OK)
|
| return result;
|
|
|
| - result = SetJobLevel(*cmd_line, sandbox::JOB_LOCKDOWN, 0, policy);
|
| + result = SetJobLevel(*cmd_line, sandbox::JOB_LOCKDOWN, 0, policy.get());
|
| if (result != sandbox::SBOX_ALL_OK)
|
| return result;
|
|
|
| if (!delegate->DisableDefaultPolicy()) {
|
| - result = AddPolicyForSandboxedProcess(policy);
|
| + result = AddPolicyForSandboxedProcess(policy.get());
|
| if (result != sandbox::SBOX_ALL_OK)
|
| return result;
|
| }
|
| @@ -765,7 +766,7 @@ sandbox::ResultCode StartSandboxedProcess(
|
| if (type_str == switches::kRendererProcess ||
|
| type_str == switches::kPpapiPluginProcess) {
|
| AddDirectory(base::DIR_WINDOWS_FONTS, NULL, true,
|
| - sandbox::TargetPolicy::FILES_ALLOW_READONLY, policy);
|
| + sandbox::TargetPolicy::FILES_ALLOW_READONLY, policy.get());
|
| }
|
| #endif
|
|
|
| @@ -776,7 +777,7 @@ sandbox::ResultCode StartSandboxedProcess(
|
| cmd_line->AppendSwitchASCII("ignored", " --type=renderer ");
|
| }
|
|
|
| - result = AddGenericPolicy(policy);
|
| + result = AddGenericPolicy(policy.get());
|
|
|
| if (result != sandbox::SBOX_ALL_OK) {
|
| NOTREACHED();
|
| @@ -801,7 +802,7 @@ sandbox::ResultCode StartSandboxedProcess(
|
| policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE));
|
| policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE));
|
|
|
| - if (!delegate->PreSpawnTarget(policy))
|
| + if (!delegate->PreSpawnTarget(policy.get()))
|
| return sandbox::SBOX_ERROR_DELEGATE_PRE_SPAWN;
|
|
|
| TRACE_EVENT_BEGIN0("startup", "StartProcessWithAccess::LAUNCHPROCESS");
|
|
|