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

Side by Side Diff: content/public/test/browser_test_base.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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/public/test/browser_test_base.h" 5 #include "content/public/test/browser_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/i18n/icu_util.h" 10 #include "base/i18n/icu_util.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 void BrowserTestBase::ProxyRunTestOnMainThreadLoop() { 276 void BrowserTestBase::ProxyRunTestOnMainThreadLoop() {
277 #if defined(OS_POSIX) 277 #if defined(OS_POSIX)
278 if (handle_sigterm_) { 278 if (handle_sigterm_) {
279 g_browser_process_pid = base::GetCurrentProcId(); 279 g_browser_process_pid = base::GetCurrentProcId();
280 signal(SIGTERM, DumpStackTraceSignalHandler); 280 signal(SIGTERM, DumpStackTraceSignalHandler);
281 } 281 }
282 #endif // defined(OS_POSIX) 282 #endif // defined(OS_POSIX)
283 283
284 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 284 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
285 switches::kEnableTracing)) { 285 switches::kEnableTracing)) {
286 base::trace_event::CategoryFilter category_filter( 286 base::trace_event::TraceConfig trace_config(
287 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 287 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
288 switches::kEnableTracing)); 288 switches::kEnableTracing),
289 base::trace_event::RECORD_CONTINUOUSLY);
289 TracingController::GetInstance()->EnableRecording( 290 TracingController::GetInstance()->EnableRecording(
290 category_filter, 291 trace_config,
291 base::trace_event::TraceOptions(base::trace_event::RECORD_CONTINUOUSLY),
292 TracingController::EnableRecordingDoneCallback()); 292 TracingController::EnableRecordingDoneCallback());
293 } 293 }
294 294
295 RunTestOnMainThreadLoop(); 295 RunTestOnMainThreadLoop();
296 296
297 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 297 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
298 switches::kEnableTracing)) { 298 switches::kEnableTracing)) {
299 base::FilePath trace_file = 299 base::FilePath trace_file =
300 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( 300 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
301 switches::kEnableTracingOutput); 301 switches::kEnableTracingOutput);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 use_software_compositing_ = true; 347 use_software_compositing_ = true;
348 } 348 }
349 349
350 bool BrowserTestBase::UsingOSMesa() const { 350 bool BrowserTestBase::UsingOSMesa() const {
351 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); 351 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
352 return cmd->GetSwitchValueASCII(switches::kUseGL) == 352 return cmd->GetSwitchValueASCII(switches::kUseGL) ==
353 gfx::kGLImplementationOSMesaName; 353 gfx::kGLImplementationOSMesaName;
354 } 354 }
355 355
356 } // namespace content 356 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/tracing_controller.h ('k') | content/renderer/devtools/devtools_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698