1From e8ce13950e6afc97ea69a36f5f234a7409269086 Mon Sep 17 00:00:00 2001 2From: hscham <[email protected]> 3Date: Fri, 17 Apr 2020 15:20:53 +0900 4Subject: [PATCH] libchrome: r680000 forward compatibility patch part 2 5 6This CL includes: 7- Rename base::LaunchOptions {,clear_}environ{=>ment}. 8 9Change-Id: I07b9b84d153e942368021be7fb89f0dd07ffebb1 10--- 11 base/process/launch.h | 6 +++--- 12 base/process/launch_posix.cc | 8 ++++---- 13 base/process/process_util_unittest.cc | 4 ++-- 14 3 files changed, 9 insertions(+), 9 deletions(-) 15 16diff --git a/base/process/launch.h b/base/process/launch.h 17index 7a2def2..84d176e 100644 18--- a/base/process/launch.h 19+++ b/base/process/launch.h 20@@ -160,11 +160,11 @@ struct BASE_EXPORT LaunchOptions { 21 // Set/unset environment variables. These are applied on top of the parent 22 // process environment. Empty (the default) means to inherit the same 23 // environment. See AlterEnvironment(). 24- EnvironmentMap environ; 25+ EnvironmentMap environment; 26 27 // Clear the environment for the new process before processing changes from 28- // |environ|. 29- bool clear_environ = false; 30+ // |environment|. 31+ bool clear_environment = false; 32 33 // Remap file descriptors according to the mapping of src_fd->dest_fd to 34 // propagate FDs into the child process. 35diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc 36index ec58488..c61db41 100644 37--- a/base/process/launch_posix.cc 38+++ b/base/process/launch_posix.cc 39@@ -324,10 +324,10 @@ Process LaunchProcess(const std::vector<std::string>& argv, 40 std::unique_ptr<char* []> new_environ; 41 char* const empty_environ = nullptr; 42 char* const* old_environ = GetEnvironment(); 43- if (options.clear_environ) 44+ if (options.clear_environment) 45 old_environ = &empty_environ; 46- if (!options.environ.empty()) 47- new_environ = AlterEnvironment(old_environ, options.environ); 48+ if (!options.environment.empty()) 49+ new_environ = AlterEnvironment(old_environ, options.environment); 50 51 sigset_t full_sigset; 52 sigfillset(&full_sigset); 53@@ -466,7 +466,7 @@ Process LaunchProcess(const std::vector<std::string>& argv, 54 fd_shuffle2.push_back(InjectionArc(value.first, value.second, false)); 55 } 56 57- if (!options.environ.empty() || options.clear_environ) 58+ if (!options.environment.empty() || options.clear_environment) 59 SetEnvironment(new_environ.get()); 60 61 // fd_shuffle1 is mutated by this call because it cannot malloc. 62diff --git a/base/process/process_util_unittest.cc b/base/process/process_util_unittest.cc 63index 4e788b7..a541e48 100644 64--- a/base/process/process_util_unittest.cc 65+++ b/base/process/process_util_unittest.cc 66@@ -1162,8 +1162,8 @@ std::string TestLaunchProcess(const std::vector<std::string>& args, 67 68 LaunchOptions options; 69 options.wait = true; 70- options.environ = env_changes; 71- options.clear_environ = clear_environ; 72+ options.environment = env_changes; 73+ options.clear_environment = clear_environ; 74 options.fds_to_remap.emplace_back(fds[1], 1); 75 #if defined(OS_LINUX) 76 options.clone_flags = clone_flags; 77-- 782.26.1.301.g55bc3eb7cb9-goog 79 80diff --git a/base/test/scoped_task_environment.h b/base/test/scoped_task_environment.h 81index f9523b3138ec..a2cc7f73d8f2 100644 82--- a/base/test/scoped_task_environment.h 83+++ b/base/test/scoped_task_environment.h 84@@ -81,6 +81,10 @@ class ScopedTaskEnvironment { 85 IO, 86 }; 87 88+ // To introduce TimeSource::MOCK_TIME behaves same as 89+ // MainThreadType::MOCK_TIME. 90+ using TimeSource = MainThreadType; 91+ 92 enum class ExecutionMode { 93 // Tasks are queued and only executed when RunUntilIdle() is explicitly 94 // called. 95