OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/public/app/content_main_runner.h" | 5 #include "content/public/app/content_main_runner.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/allocator/allocator_extension.h" | 9 #include "base/allocator/allocator_extension.h" |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 completed_basic_startup_ = true; | 523 completed_basic_startup_ = true; |
524 | 524 |
525 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 525 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
526 std::string process_type = | 526 std::string process_type = |
527 command_line.GetSwitchValueASCII(switches::kProcessType); | 527 command_line.GetSwitchValueASCII(switches::kProcessType); |
528 | 528 |
529 if (!GetContentClient()) | 529 if (!GetContentClient()) |
530 SetContentClient(&empty_content_client_); | 530 SetContentClient(&empty_content_client_); |
531 ContentClientInitializer::Set(process_type, delegate_); | 531 ContentClientInitializer::Set(process_type, delegate_); |
532 | 532 |
| 533 #if defined(OS_WIN) |
| 534 // Route stdio to parent console (if any) or create one. |
| 535 if (command_line.HasSwitch(switches::kEnableLogging)) |
| 536 base::RouteStdioToConsole(); |
| 537 #endif |
| 538 |
533 // Enable startup tracing asap to avoid early TRACE_EVENT calls being | 539 // Enable startup tracing asap to avoid early TRACE_EVENT calls being |
534 // ignored. | 540 // ignored. |
535 if (command_line.HasSwitch(switches::kTraceStartup)) { | 541 if (command_line.HasSwitch(switches::kTraceStartup)) { |
536 base::debug::TraceLog::GetInstance()->SetEnabled( | 542 base::debug::TraceLog::GetInstance()->SetEnabled( |
537 command_line.GetSwitchValueASCII(switches::kTraceStartup)); | 543 command_line.GetSwitchValueASCII(switches::kTraceStartup)); |
538 } | 544 } |
539 | 545 |
540 #if defined(OS_MACOSX) | 546 #if defined(OS_MACOSX) |
541 // We need to allocate the IO Ports before the Sandbox is initialized or | 547 // We need to allocate the IO Ports before the Sandbox is initialized or |
542 // the first instance of SystemMonitor is created. | 548 // the first instance of SystemMonitor is created. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 | 709 |
704 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 710 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
705 }; | 711 }; |
706 | 712 |
707 // static | 713 // static |
708 ContentMainRunner* ContentMainRunner::Create() { | 714 ContentMainRunner* ContentMainRunner::Create() { |
709 return new ContentMainRunnerImpl(); | 715 return new ContentMainRunnerImpl(); |
710 } | 716 } |
711 | 717 |
712 } // namespace content | 718 } // namespace content |
OLD | NEW |