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

Unified Diff: content/app/content_main_runner.cc

Issue 2683913002: Enable startup tracing from command line flags in components/tracing (Closed)
Patch Set: . Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index ee6ab17a0dc24ac400302dd074a0b2cdae168332..5f5dec4d1ac701557a77512c63d4b9dd6278a91e 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -41,9 +41,7 @@
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
-#include "components/tracing/browser/trace_config_file.h"
-#include "components/tracing/common/trace_to_console.h"
-#include "components/tracing/common/tracing_switches.h"
+#include "components/tracing/common/startup_command_parser.h"
#include "content/app/mojo/mojo_init.h"
#include "content/browser/browser_main.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
@@ -610,31 +608,11 @@ class ContentMainRunnerImpl : public ContentMainRunner {
// Enable startup tracing asap to avoid early TRACE_EVENT calls being
// ignored. For Android, startup tracing is enabled in an even earlier place
// content/app/android/library_loader_hooks.cc.
- if (command_line.HasSwitch(switches::kTraceStartup)) {
- base::trace_event::TraceConfig trace_config(
- command_line.GetSwitchValueASCII(switches::kTraceStartup),
- base::trace_event::RECORD_UNTIL_FULL);
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- trace_config,
- base::trace_event::TraceLog::RECORDING_MODE);
- } else if (command_line.HasSwitch(switches::kTraceToConsole)) {
- base::trace_event::TraceConfig trace_config =
- tracing::GetConfigForTraceToConsole();
- LOG(ERROR) << "Start " << switches::kTraceToConsole
- << " with CategoryFilter '"
- << trace_config.ToCategoryFilterString() << "'.";
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- trace_config,
- base::trace_event::TraceLog::RECORDING_MODE);
- } else if (process_type != switches::kZygoteProcess &&
- process_type != switches::kRendererProcess) {
- if (tracing::TraceConfigFile::GetInstance()->IsEnabled()) {
- // This checks kTraceConfigFile switch.
- base::trace_event::TraceLog::GetInstance()->SetEnabled(
- tracing::TraceConfigFile::GetInstance()->GetTraceConfig(),
- base::trace_event::TraceLog::RECORDING_MODE);
- }
- }
+ // Zygote process does not have file thread and renderer process on Win10
+ // cannot access the file system.
+ bool can_access_file_system = (process_type != switches::kZygoteProcess &&
+ process_type != switches::kRendererProcess);
+ tracing::ParseStartupTraceCommands(command_line, can_access_file_system);
#endif // !OS_ANDROID
#if defined(OS_WIN)

Powered by Google App Engine
This is Rietveld 408576698