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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "content/public/plugin/content_plugin_client.h" | 70 #include "content/public/plugin/content_plugin_client.h" |
71 #include "content/public/renderer/content_renderer_client.h" | 71 #include "content/public/renderer/content_renderer_client.h" |
72 #include "content/public/utility/content_utility_client.h" | 72 #include "content/public/utility/content_utility_client.h" |
73 #endif | 73 #endif |
74 | 74 |
75 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
76 #include <malloc.h> | 76 #include <malloc.h> |
77 #include <cstring> | 77 #include <cstring> |
78 | 78 |
79 #include "base/strings/string_number_conversions.h" | 79 #include "base/strings/string_number_conversions.h" |
| 80 #include "base/trace_event/trace_event_etw_export_win.h" |
80 #include "ui/base/win/atl_module.h" | 81 #include "ui/base/win/atl_module.h" |
81 #include "ui/gfx/win/dpi.h" | 82 #include "ui/gfx/win/dpi.h" |
82 #elif defined(OS_MACOSX) | 83 #elif defined(OS_MACOSX) |
83 #include "base/mac/scoped_nsautorelease_pool.h" | 84 #include "base/mac/scoped_nsautorelease_pool.h" |
84 #if !defined(OS_IOS) | 85 #if !defined(OS_IOS) |
85 #include "base/power_monitor/power_monitor_device_source.h" | 86 #include "base/power_monitor/power_monitor_device_source.h" |
86 #include "content/browser/mach_broker_mac.h" | 87 #include "content/browser/mach_broker_mac.h" |
87 #include "content/common/sandbox_init_mac.h" | 88 #include "content/common/sandbox_init_mac.h" |
88 #endif // !OS_IOS | 89 #endif // !OS_IOS |
89 #endif // OS_WIN | 90 #endif // OS_WIN |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 // ignored. | 626 // ignored. |
626 if (command_line.HasSwitch(switches::kTraceStartup)) { | 627 if (command_line.HasSwitch(switches::kTraceStartup)) { |
627 base::trace_event::CategoryFilter category_filter( | 628 base::trace_event::CategoryFilter category_filter( |
628 command_line.GetSwitchValueASCII(switches::kTraceStartup)); | 629 command_line.GetSwitchValueASCII(switches::kTraceStartup)); |
629 base::trace_event::TraceLog::GetInstance()->SetEnabled( | 630 base::trace_event::TraceLog::GetInstance()->SetEnabled( |
630 category_filter, | 631 category_filter, |
631 base::trace_event::TraceLog::RECORDING_MODE, | 632 base::trace_event::TraceLog::RECORDING_MODE, |
632 base::trace_event::TraceOptions( | 633 base::trace_event::TraceOptions( |
633 base::trace_event::RECORD_UNTIL_FULL)); | 634 base::trace_event::RECORD_UNTIL_FULL)); |
634 } | 635 } |
| 636 #if defined(OS_WIN) |
| 637 // Enable exporting of events to ETW if requested on the command line. |
| 638 if (command_line.HasSwitch(switches::kTraceExportEventsToETW)) |
| 639 base::trace_event::TraceEventETWExport::EnableETWExport(); |
| 640 #endif // OS_WIN |
| 641 |
635 #if !defined(OS_ANDROID) | 642 #if !defined(OS_ANDROID) |
636 // Android tracing started at the beginning of the method. | 643 // Android tracing started at the beginning of the method. |
637 // Other OSes have to wait till we get here in order for all the memory | 644 // Other OSes have to wait till we get here in order for all the memory |
638 // management setup to be completed. | 645 // management setup to be completed. |
639 TRACE_EVENT0("startup", "ContentMainRunnerImpl::Initialize"); | 646 TRACE_EVENT0("startup", "ContentMainRunnerImpl::Initialize"); |
640 #endif // !OS_ANDROID | 647 #endif // !OS_ANDROID |
641 | 648 |
642 #if defined(OS_MACOSX) && !defined(OS_IOS) | 649 #if defined(OS_MACOSX) && !defined(OS_IOS) |
643 // We need to allocate the IO Ports before the Sandbox is initialized or | 650 // We need to allocate the IO Ports before the Sandbox is initialized or |
644 // the first instance of PowerMonitor is created. | 651 // the first instance of PowerMonitor is created. |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 | 840 |
834 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 841 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
835 }; | 842 }; |
836 | 843 |
837 // static | 844 // static |
838 ContentMainRunner* ContentMainRunner::Create() { | 845 ContentMainRunner* ContentMainRunner::Create() { |
839 return new ContentMainRunnerImpl(); | 846 return new ContentMainRunnerImpl(); |
840 } | 847 } |
841 | 848 |
842 } // namespace content | 849 } // namespace content |
OLD | NEW |