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