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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 18174006: Allow tracing to console everywhere. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 32109c0d41ac8dfc4a4456a06aad7e015f458788..bf1352dcf572796bd7ea1b817764bb86f753c26e 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -10,6 +10,7 @@
#include <vector>
#include "base/allocator/allocator_extension.h"
+#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/lazy_instance.h"
@@ -397,6 +398,19 @@ void RenderThreadImpl::Init() {
RegisterExtension(SkiaBenchmarkingExtension::Get());
}
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceToConsole)) {
piman 2013/07/03 17:42:28 Could we move this to ChildThread, so that it appl
Ian Vollick 2013/07/03 18:48:03 That's a great idea. Done.
+ std::string category_string =
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kTraceToConsole);
+
+ if (!category_string.size())
+ category_string = "*";
+
+ base::debug::TraceLog::GetInstance()->SetEnabled(
+ base::debug::CategoryFilter(category_string),
+ base::debug::TraceLog::ECHO_TO_CONSOLE);
+ }
+
context_lost_cb_.reset(new GpuVDAContextLostCallback());
// Note that under Linux, the media library will normally already have

Powered by Google App Engine
This is Rietveld 408576698