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