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

Unified Diff: content/common/sandbox_win.cc

Issue 2193603004: Ignore desktop creation errors in the sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | sandbox/win/src/window.cc » ('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 baa2470971d11a792fc27fe66f66187842ac83ce..0557df77e93d119b30d5f3f622c902ab0cca0791 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -371,6 +371,12 @@ sandbox::ResultCode AddGenericPolicy(sandbox::TargetPolicy* policy) {
return sandbox::SBOX_ALL_OK;
}
+void LogLaunchWarning(sandbox::ResultCode last_warning, DWORD last_error) {
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.WarningResultCode",
+ last_warning);
+ UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.Warning", last_error);
+}
+
sandbox::ResultCode AddPolicyForSandboxedProcess(
sandbox::TargetPolicy* policy) {
sandbox::ResultCode result = sandbox::SBOX_ALL_OK;
@@ -410,8 +416,11 @@ sandbox::ResultCode AddPolicyForSandboxedProcess(
result = policy->SetAlternateDesktop(true);
if (result != sandbox::SBOX_ALL_OK) {
+ // We ignore the result of setting the alternate desktop, however log
+ // a launch warning.
+ LogLaunchWarning(result, ::GetLastError());
DLOG(WARNING) << "Failed to apply desktop security to the renderer";
- return result;
+ result = sandbox::SBOX_ALL_OK;
}
return result;
@@ -819,9 +828,7 @@ sandbox::ResultCode StartSandboxedProcess(
}
if (sandbox::SBOX_ALL_OK != last_warning) {
- UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.WarningResultCode",
- last_warning);
- UMA_HISTOGRAM_SPARSE_SLOWLY("Process.Sandbox.Launch.Warning", last_error);
+ LogLaunchWarning(last_warning, last_error);
}
delegate->PostSpawnTarget(target.process_handle());
« no previous file with comments | « no previous file | sandbox/win/src/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698