| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <iostream> | 9 #include <iostream> |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 flush_complete_event.Wait(); | 76 flush_complete_event.Wait(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace | 79 } // namespace |
| 80 | 80 |
| 81 int LauncherProcessMain(int argc, char** argv) { | 81 int LauncherProcessMain(int argc, char** argv) { |
| 82 const base::CommandLine& command_line = | 82 const base::CommandLine& command_line = |
| 83 *base::CommandLine::ForCurrentProcess(); | 83 *base::CommandLine::ForCurrentProcess(); |
| 84 if (command_line.HasSwitch(switches::kTraceStartup)) { | 84 if (command_line.HasSwitch(switches::kTraceStartup)) { |
| 85 g_tracing = true; | 85 g_tracing = true; |
| 86 base::trace_event::CategoryFilter category_filter( | 86 base::trace_event::TraceConfig trace_config( |
| 87 command_line.GetSwitchValueASCII(switches::kTraceStartup)); | 87 command_line.GetSwitchValueASCII(switches::kTraceStartup), |
| 88 base::trace_event::RECORD_UNTIL_FULL); |
| 88 base::trace_event::TraceLog::GetInstance()->SetEnabled( | 89 base::trace_event::TraceLog::GetInstance()->SetEnabled( |
| 89 category_filter, base::trace_event::TraceLog::RECORDING_MODE, | 90 trace_config, base::trace_event::TraceLog::RECORDING_MODE); |
| 90 base::trace_event::TraceOptions(base::trace_event::RECORD_UNTIL_FULL)); | |
| 91 } | 91 } |
| 92 | 92 |
| 93 // We want the runner::Context to outlive the MessageLoop so that pipes are | 93 // We want the runner::Context to outlive the MessageLoop so that pipes are |
| 94 // all gracefully closed / error-out before we try to shut the Context down. | 94 // all gracefully closed / error-out before we try to shut the Context down. |
| 95 mojo::runner::Context shell_context; | 95 mojo::runner::Context shell_context; |
| 96 InitCoreServicesForContext(&shell_context); | 96 InitCoreServicesForContext(&shell_context); |
| 97 { | 97 { |
| 98 base::MessageLoop message_loop; | 98 base::MessageLoop message_loop; |
| 99 if (!shell_context.Init()) { | 99 if (!shell_context.Init()) { |
| 100 return 0; | 100 return 0; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 114 // Must be called before |message_loop| is destroyed. | 114 // Must be called before |message_loop| is destroyed. |
| 115 shell_context.Shutdown(); | 115 shell_context.Shutdown(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 if (g_tracing) | 118 if (g_tracing) |
| 119 StopTracingAndFlushToDisk(); | 119 StopTracingAndFlushToDisk(); |
| 120 return 0; | 120 return 0; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace mandoline | 123 } // namespace mandoline |
| OLD | NEW |