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