Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Unified Diff: content/common/sandbox_win.cc

Issue 1024463005: Added UMA metrics to track errors while launching lowbox enabled sandboxed process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added link to MSDN GetLastError error codes. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_win.cc
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
index 17893ffa6fd399677431f2a16d8019002308ad03..c0279d0eaf328d1cda2b34f6d381474f872f82c2 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -11,6 +11,7 @@
#include "base/debug/profiler.h"
#include "base/files/file_util.h"
#include "base/hash.h"
+#include "base/metrics/sparse_histogram.h"
#include "base/path_service.h"
#include "base/process/launch.h"
#include "base/strings/string_util.h"
@@ -28,6 +29,7 @@
#include "sandbox/win/src/process_mitigations.h"
#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/sandbox_nt_util.h"
+#include "sandbox/win/src/sandbox_policy_base.h"
#include "sandbox/win/src/win_utils.h"
#include "ui/gfx/win/direct_write.h"
@@ -724,6 +726,7 @@ base::Process StartSandboxedProcess(
cmd_line->GetProgram().value().c_str(),
cmd_line->GetCommandLineString().c_str(),
policy, &temp_process_info);
+ DWORD last_error = ::GetLastError();
policy->Release();
base::win::ScopedProcessInformation target(temp_process_info);
@@ -734,6 +737,13 @@ base::Process StartSandboxedProcess(
DPLOG(ERROR) << "Failed to launch process";
else
DLOG(ERROR) << "Failed to launch process. Error: " << result;
+
+ sandbox::PolicyBase* policy_base =
+ static_cast<sandbox::PolicyBase*>(policy);
+ if (policy_base->GetLowBoxSid()) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Lowbox.Launch.Error",
+ last_error);
+ }
return base::Process();
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698