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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
62 #include <atlbase.h> | 62 #include <atlbase.h> |
63 #include <atlapp.h> | 63 #include <atlapp.h> |
64 #include <malloc.h> | 64 #include <malloc.h> |
65 #include <cstring> | 65 #include <cstring> |
66 #elif defined(OS_MACOSX) | 66 #elif defined(OS_MACOSX) |
67 #include "base/mac/scoped_nsautorelease_pool.h" | 67 #include "base/mac/scoped_nsautorelease_pool.h" |
68 #if !defined(OS_IOS) | 68 #if !defined(OS_IOS) |
69 #include "base/mach_ipc_mac.h" | 69 #include "base/mach_ipc_mac.h" |
70 #include "base/system_monitor/system_monitor.h" | 70 #include "base/power_monitor/power_monitor.h" |
71 #include "content/browser/mach_broker_mac.h" | 71 #include "content/browser/mach_broker_mac.h" |
72 #include "content/common/sandbox_init_mac.h" | 72 #include "content/common/sandbox_init_mac.h" |
73 #endif // !OS_IOS | 73 #endif // !OS_IOS |
74 #endif // OS_WIN | 74 #endif // OS_WIN |
75 | 75 |
76 #if defined(OS_POSIX) | 76 #if defined(OS_POSIX) |
77 #include <signal.h> | 77 #include <signal.h> |
78 | 78 |
79 #include "base/posix/global_descriptors.h" | 79 #include "base/posix/global_descriptors.h" |
80 #include "content/public/common/content_descriptors.h" | 80 #include "content/public/common/content_descriptors.h" |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 // Enable startup tracing asap to avoid early TRACE_EVENT calls being | 644 // Enable startup tracing asap to avoid early TRACE_EVENT calls being |
645 // ignored. | 645 // ignored. |
646 if (command_line.HasSwitch(switches::kTraceStartup)) { | 646 if (command_line.HasSwitch(switches::kTraceStartup)) { |
647 base::debug::TraceLog::GetInstance()->SetEnabled( | 647 base::debug::TraceLog::GetInstance()->SetEnabled( |
648 command_line.GetSwitchValueASCII(switches::kTraceStartup), | 648 command_line.GetSwitchValueASCII(switches::kTraceStartup), |
649 base::debug::TraceLog::RECORD_UNTIL_FULL); | 649 base::debug::TraceLog::RECORD_UNTIL_FULL); |
650 } | 650 } |
651 | 651 |
652 #if defined(OS_MACOSX) && !defined(OS_IOS) | 652 #if defined(OS_MACOSX) && !defined(OS_IOS) |
653 // We need to allocate the IO Ports before the Sandbox is initialized or | 653 // We need to allocate the IO Ports before the Sandbox is initialized or |
654 // the first instance of SystemMonitor is created. | 654 // the first instance of PowerMonitor is created. |
655 // It's important not to allocate the ports for processes which don't | 655 // It's important not to allocate the ports for processes which don't |
656 // register with the system monitor - see crbug.com/88867. | 656 // register with the power monitor - see crbug.com/88867. |
657 if (process_type.empty() || | 657 if (process_type.empty() || |
658 process_type == switches::kPluginProcess || | 658 process_type == switches::kPluginProcess || |
659 process_type == switches::kRendererProcess || | 659 process_type == switches::kRendererProcess || |
660 process_type == switches::kUtilityProcess || | 660 process_type == switches::kUtilityProcess || |
661 process_type == switches::kWorkerProcess || | 661 process_type == switches::kWorkerProcess || |
662 (delegate && | 662 (delegate && |
663 delegate->ProcessRegistersWithSystemProcess(process_type))) { | 663 delegate->ProcessRegistersWithSystemProcess(process_type))) { |
664 base::SystemMonitor::AllocateSystemIOPorts(); | 664 base::PowerMonitor::AllocateSystemIOPorts(); |
665 } | 665 } |
666 | 666 |
667 if (!process_type.empty() && | 667 if (!process_type.empty() && |
668 (!delegate || delegate->ShouldSendMachPort(process_type))) { | 668 (!delegate || delegate->ShouldSendMachPort(process_type))) { |
669 SendTaskPortToParentProcess(); | 669 SendTaskPortToParentProcess(); |
670 } | 670 } |
671 #elif defined(OS_WIN) | 671 #elif defined(OS_WIN) |
672 // This must be done early enough since some helper functions like | 672 // This must be done early enough since some helper functions like |
673 // IsTouchEnabled, needed to load resources, may call into the theme dll. | 673 // IsTouchEnabled, needed to load resources, may call into the theme dll. |
674 EnableThemeSupportOnAllWindowStations(); | 674 EnableThemeSupportOnAllWindowStations(); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 | 822 |
823 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 823 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
824 }; | 824 }; |
825 | 825 |
826 // static | 826 // static |
827 ContentMainRunner* ContentMainRunner::Create() { | 827 ContentMainRunner* ContentMainRunner::Create() { |
828 return new ContentMainRunnerImpl(); | 828 return new ContentMainRunnerImpl(); |
829 } | 829 } |
830 | 830 |
831 } // namespace content | 831 } // namespace content |
OLD | NEW |