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

Unified Diff: mojo/runner/host/child_process_host.cc

Issue 1441853003: Make the new Mojo EDK work on XP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fixes Created 5 years, 1 month 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
Index: mojo/runner/host/child_process_host.cc
diff --git a/mojo/runner/host/child_process_host.cc b/mojo/runner/host/child_process_host.cc
index 268deff3df6b745163984071166e2d4b63aa18b9..10a24396c20d7dbb2578612c2cb2d09c97c166df 100644
--- a/mojo/runner/host/child_process_host.cc
+++ b/mojo/runner/host/child_process_host.cc
@@ -23,6 +23,10 @@
#include "sandbox/linux/services/namespace_sandbox.h"
#endif
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif
+
namespace mojo {
namespace runner {
@@ -135,7 +139,14 @@ void ChildProcessHost::DoLaunch() {
base::LaunchOptions options;
#if defined(OS_WIN)
- options.handles_to_inherit = &handle_passing_info;
+ if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
+ options.handles_to_inherit = &handle_passing_info;
+ } else {
+#if defined(OFFICIAL_BUILD)
+ CHECK(false) << "Launching mojo process with inherit_handles is insecure!";
+#endif
+ options.inherit_handles = true;
+ }
options.stdin_handle = INVALID_HANDLE_VALUE;
options.stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
options.stderr_handle = GetStdHandle(STD_ERROR_HANDLE);
« mojo/edk/system/core_unittest.cc ('K') | « mojo/edk/test/multiprocess_test_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698