OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/app/mash/mash_runner.h" | 5 #include "chrome/app/mash/mash_runner.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void AdjustCommandLineArgumentsForTarget( | 66 void AdjustCommandLineArgumentsForTarget( |
67 const shell::Identity& target, | 67 const shell::Identity& target, |
68 base::CommandLine* command_line) override { | 68 base::CommandLine* command_line) override { |
69 if (target.name() != "exe:chrome") { | 69 if (target.name() != "exe:chrome") { |
70 if (target.name() == "exe:chrome_mash") | 70 if (target.name() == "exe:chrome_mash") |
71 ChangeChromeMashToChrome(command_line); | 71 ChangeChromeMashToChrome(command_line); |
72 command_line->AppendSwitchASCII(switches::kProcessType, kMashChild); | 72 command_line->AppendSwitchASCII(switches::kProcessType, kMashChild); |
73 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
74 command_line->AppendArg(switches::kPrefetchArgumentOther); | 74 command_line->AppendArg(switches::kPrefetchArgumentOther); |
75 #endif | 75 #endif |
| 76 if (target.instance() == "font_service" || target.instance() == "ui") { |
| 77 base::CommandLine::StringVector argv(command_line->argv()); |
| 78 auto iter = std::find(argv.begin(), argv.end(), |
| 79 FILE_PATH_LITERAL("--enable-sandbox")); |
| 80 if (iter != argv.end()) |
| 81 argv.erase(iter); |
| 82 *command_line = base::CommandLine(argv); |
| 83 } |
76 return; | 84 return; |
77 } | 85 } |
78 | 86 |
79 base::CommandLine::StringVector argv(command_line->argv()); | 87 base::CommandLine::StringVector argv(command_line->argv()); |
80 auto iter = | 88 auto iter = |
81 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--mash")); | 89 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--mash")); |
82 if (iter != argv.end()) | 90 if (iter != argv.end()) |
83 argv.erase(iter); | 91 argv.erase(iter); |
84 *command_line = base::CommandLine(argv); | 92 *command_line = base::CommandLine(argv); |
85 } | 93 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 tracing::GetConfigForTraceToConsole(); | 170 tracing::GetConfigForTraceToConsole(); |
163 base::trace_event::TraceLog::GetInstance()->SetEnabled( | 171 base::trace_event::TraceLog::GetInstance()->SetEnabled( |
164 trace_config, | 172 trace_config, |
165 base::trace_event::TraceLog::RECORDING_MODE); | 173 base::trace_event::TraceLog::RECORDING_MODE); |
166 } | 174 } |
167 | 175 |
168 MashRunner mash_runner; | 176 MashRunner mash_runner; |
169 mash_runner.Run(); | 177 mash_runner.Run(); |
170 return 0; | 178 return 0; |
171 } | 179 } |
OLD | NEW |