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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
625 | 625 |
626 // Enable startup tracing asap to avoid early TRACE_EVENT calls being | 626 // Enable startup tracing asap to avoid early TRACE_EVENT calls being |
627 // ignored. | 627 // ignored. |
628 if (command_line.HasSwitch(switches::kTraceStartup)) { | 628 if (command_line.HasSwitch(switches::kTraceStartup)) { |
629 base::trace_event::TraceConfig trace_config( | 629 base::trace_event::TraceConfig trace_config( |
630 command_line.GetSwitchValueASCII(switches::kTraceStartup), | 630 command_line.GetSwitchValueASCII(switches::kTraceStartup), |
631 base::trace_event::RECORD_UNTIL_FULL); | 631 base::trace_event::RECORD_UNTIL_FULL); |
632 base::trace_event::TraceLog::GetInstance()->SetEnabled( | 632 base::trace_event::TraceLog::GetInstance()->SetEnabled( |
633 trace_config, | 633 trace_config, |
634 base::trace_event::TraceLog::RECORDING_MODE); | 634 base::trace_event::TraceLog::RECORDING_MODE); |
635 } else if (process_type != switches::kZygoteProcess) { | 635 } else if (process_type != switches::kZygoteProcess && |
636 process_type != switches::kRendererProcess) { | |
636 // There is no need to schedule stopping tracing in this case. Telemetry | 637 // There is no need to schedule stopping tracing in this case. Telemetry |
637 // will stop tracing on demand later. | 638 // will stop tracing on demand later. |
Zhen Wang
2015/07/01 00:41:43
Can you add some comment here to explain why it is
| |
638 tracing::EnableStartupTracingIfConfigFileExists(); | 639 tracing::EnableStartupTracingIfConfigFileExists(); |
639 } | 640 } |
640 | 641 |
641 #if defined(OS_WIN) | 642 #if defined(OS_WIN) |
642 // Enable exporting of events to ETW if requested on the command line. | 643 // Enable exporting of events to ETW if requested on the command line. |
643 if (command_line.HasSwitch(switches::kTraceExportEventsToETW)) | 644 if (command_line.HasSwitch(switches::kTraceExportEventsToETW)) |
644 base::trace_event::TraceEventETWExport::EnableETWExport(); | 645 base::trace_event::TraceEventETWExport::EnableETWExport(); |
645 #endif // OS_WIN | 646 #endif // OS_WIN |
646 | 647 |
647 #if !defined(OS_ANDROID) | 648 #if !defined(OS_ANDROID) |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
867 | 868 |
868 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 869 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
869 }; | 870 }; |
870 | 871 |
871 // static | 872 // static |
872 ContentMainRunner* ContentMainRunner::Create() { | 873 ContentMainRunner* ContentMainRunner::Create() { |
873 return new ContentMainRunnerImpl(); | 874 return new ContentMainRunnerImpl(); |
874 } | 875 } |
875 | 876 |
876 } // namespace content | 877 } // namespace content |
OLD | NEW |