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

Unified Diff: content/child/child_thread.cc

Issue 18174006: Allow tracing to console everywhere. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 5 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698