Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: mojo/runner/desktop/launcher_process.cc

Issue 1165673002: [Startup Tracing] Hook up TraceConfig and remove CategoryFilter & TraceOptions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/common/trace_controller_impl.cc ('k') | net/log/trace_net_log_observer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mojo/common/trace_controller_impl.cc ('k') | net/log/trace_net_log_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698