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