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 = |
| 79 std::find(argv.begin(), argv.end(), |
| 80 FILE_PATH_LITERAL("--enable-sandbox")); |
| 81 if (iter != argv.end()) |
| 82 argv.erase(iter); |
| 83 *command_line = base::CommandLine(argv); |
| 84 } |
76 return; | 85 return; |
77 } | 86 } |
78 | 87 |
79 base::CommandLine::StringVector argv(command_line->argv()); | 88 base::CommandLine::StringVector argv(command_line->argv()); |
80 auto iter = | 89 auto iter = |
81 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--mash")); | 90 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--mash")); |
82 if (iter != argv.end()) | 91 if (iter != argv.end()) |
83 argv.erase(iter); | 92 argv.erase(iter); |
84 *command_line = base::CommandLine(argv); | 93 *command_line = base::CommandLine(argv); |
85 } | 94 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 tracing::GetConfigForTraceToConsole(); | 171 tracing::GetConfigForTraceToConsole(); |
163 base::trace_event::TraceLog::GetInstance()->SetEnabled( | 172 base::trace_event::TraceLog::GetInstance()->SetEnabled( |
164 trace_config, | 173 trace_config, |
165 base::trace_event::TraceLog::RECORDING_MODE); | 174 base::trace_event::TraceLog::RECORDING_MODE); |
166 } | 175 } |
167 | 176 |
168 MashRunner mash_runner; | 177 MashRunner mash_runner; |
169 mash_runner.Run(); | 178 mash_runner.Run(); |
170 return 0; | 179 return 0; |
171 } | 180 } |
OLD | NEW |