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

Unified Diff: base/process_util_win.cc

Issue 10832309: Make printf and LOG output to cmd console for Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 8 years, 4 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 | « base/process_util.h ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_win.cc
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index c5ba392920ec5bed6489445da3355b74c4f8b3f1..2e955d02398a9f61db78ae9b9544ef73498242f7 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -71,6 +71,11 @@ long WINAPI StackDumpExceptionFilter(EXCEPTION_POINTERS* info) {
// Connects back to a console if available.
void AttachToConsole() {
brettw 2012/08/19 23:26:46 Maybe just rename this one and move out of the ano
jbates 2012/08/20 17:43:00 Done.
+ static bool g_attached = false;
+ if (g_attached)
+ return;
+ g_attached = true;
+
if (!AttachConsole(ATTACH_PARENT_PROCESS)) {
M-A Ruel 2012/08/20 12:42:29 This already takes care of not doing it 2 times in
jbates 2012/08/20 17:43:00 Done.
unsigned int result = GetLastError();
// Was probably already attached.
@@ -167,6 +172,10 @@ void TimerExpiredTask::KillProcess() {
} // namespace
+void RouteStdioToConsole() {
+ AttachToConsole();
+}
+
ProcessId GetCurrentProcId() {
return ::GetCurrentProcessId();
}
« no previous file with comments | « base/process_util.h ('k') | content/app/content_main_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698