Chromium Code Reviews| Index: content/common/sandbox_win.cc |
| diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc |
| index 35c33d597cc2a730df0c55f89cfa67fb6ea27f5f..9db2a3838622870611566dcb118e1e60421d9772 100644 |
| --- a/content/common/sandbox_win.cc |
| +++ b/content/common/sandbox_win.cc |
| @@ -797,9 +797,11 @@ sandbox::ResultCode StartSandboxedProcess( |
| TRACE_EVENT_BEGIN0("startup", "StartProcessWithAccess::LAUNCHPROCESS"); |
| PROCESS_INFORMATION temp_process_info = {}; |
| - result = g_broker_services->SpawnTarget( |
| - cmd_line->GetProgram().value().c_str(), |
| - cmd_line->GetCommandLineString().c_str(), policy, &temp_process_info); |
| + sandbox::ResultCode last_warning = sandbox::SBOX_ALL_OK; |
| + result = |
| + g_broker_services->SpawnTarget(cmd_line->GetProgram().value().c_str(), |
| + cmd_line->GetCommandLineString().c_str(), |
| + policy, &last_warning, &temp_process_info); |
| DWORD last_error = ::GetLastError(); |
|
Will Harris
2016/07/12 16:10:59
Seems anachronistic to pass the last_error by SetL
|
| base::win::ScopedProcessInformation target(temp_process_info); |
| @@ -815,6 +817,12 @@ sandbox::ResultCode StartSandboxedProcess( |
| return result; |
| } |
| + if (sandbox::SBOX_ALL_OK != last_warning) { |
| + UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.WarningResultCode", |
|
Will Harris
2016/07/12 16:10:59
it might be an idea to always log this first histo
|
| + last_warning); |
| + UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.Warning", last_error); |
| + } |
| + |
| delegate->PostSpawnTarget(target.process_handle()); |
| CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1)); |