summaryrefslogtreecommitdiffstats
path: root/chrome/service
diff options
context:
space:
mode:
authorvitalybuka <vitalybuka@chromium.org>2014-09-04 18:24:29 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-05 01:26:45 +0000
commit13db9e4e90bf7809af656f04a7d5bda626cdc893 (patch)
tree28458610a016dde821d9b7913131b4bea4e496a2 /chrome/service
parentb8f89b3e0ae6d464c6f0a264ee28b2bbe8b4f087 (diff)
downloadchromium_src-13db9e4e90bf7809af656f04a7d5bda626cdc893.zip
chromium_src-13db9e4e90bf7809af656f04a7d5bda626cdc893.tar.gz
chromium_src-13db9e4e90bf7809af656f04a7d5bda626cdc893.tar.bz2
Use SetAlternateDesktop(false) for service process.
Service process may run as windows service and it fails to create a window station. BUG=410237 Review URL: https://codereview.chromium.org/534413002 Cr-Commit-Position: refs/heads/master@{#293391}
Diffstat (limited to 'chrome/service')
-rw-r--r--chrome/service/DEPS1
-rw-r--r--chrome/service/service_utility_process_host.cc8
2 files changed, 9 insertions, 0 deletions
diff --git a/chrome/service/DEPS b/chrome/service/DEPS
index 23e8fba..8a4c07a 100644
--- a/chrome/service/DEPS
+++ b/chrome/service/DEPS
@@ -1,3 +1,4 @@
include_rules = [
"+chrome/grit", # For generated headers.
+ "+sandbox/win/src",
]
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index d649ba74..df2cf94 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -32,6 +32,7 @@
#include "content/public/common/sandbox_init.h"
#include "content/public/common/sandboxed_process_launcher_delegate.h"
#include "printing/emf_win.h"
+#include "sandbox/win/src/sandbox_policy_base.h"
namespace {
@@ -49,6 +50,13 @@ class ServiceSandboxedProcessLauncherDelegate
*exposed_dir = exposed_dir_;
}
+ virtual void PreSpawnTarget(sandbox::TargetPolicy* policy,
+ bool* success) OVERRIDE {
+ // Service process may run as windows service and it fails to create a
+ // window station.
+ policy->SetAlternateDesktop(false);
+ }
+
private:
base::FilePath exposed_dir_;
};