Index: content/child/child_thread.cc |
diff --git a/content/child/child_thread.cc b/content/child/child_thread.cc |
index 68c338a8276faa512743d2b61f1ab68e14466b92..f5061bfe16c5432c278bcd7bc0b3f0d4a751b52b 100644 |
--- a/content/child/child_thread.cc |
+++ b/content/child/child_thread.cc |
@@ -5,6 +5,7 @@ |
#include "content/child/child_thread.h" |
#include "base/allocator/allocator_extension.h" |
+#include "base/base_switches.h" |
#include "base/command_line.h" |
#include "base/lazy_instance.h" |
#include "base/message_loop.h" |
@@ -150,6 +151,19 @@ void ChildThread::Init() { |
channel_->AddFilter(new SuicideOnChannelErrorFilter()); |
#endif |
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceToConsole)) { |
+ 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); |
+ } |
+ |
base::MessageLoop::current()->PostDelayedTask( |
FROM_HERE, |
base::Bind(&ChildThread::EnsureConnected, |