| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
| 55 #include <cstring> | 55 #include <cstring> |
| 56 #include <atlbase.h> | 56 #include <atlbase.h> |
| 57 #include <atlapp.h> | 57 #include <atlapp.h> |
| 58 #include <malloc.h> | 58 #include <malloc.h> |
| 59 #elif defined(OS_MACOSX) | 59 #elif defined(OS_MACOSX) |
| 60 #include "base/mac/scoped_nsautorelease_pool.h" | 60 #include "base/mac/scoped_nsautorelease_pool.h" |
| 61 #if !defined(OS_IOS) | 61 #if !defined(OS_IOS) |
| 62 #include "base/mach_ipc_mac.h" | 62 #include "base/mach_ipc_mac.h" |
| 63 #include "base/system_monitor/system_monitor.h" | 63 #include "base/power_state_manager.h" |
| 64 #include "content/browser/mach_broker_mac.h" | 64 #include "content/browser/mach_broker_mac.h" |
| 65 #include "content/common/sandbox_init_mac.h" | 65 #include "content/common/sandbox_init_mac.h" |
| 66 #endif // !OS_IOS | 66 #endif // !OS_IOS |
| 67 #endif // OS_WIN | 67 #endif // OS_WIN |
| 68 | 68 |
| 69 #if defined(OS_POSIX) | 69 #if defined(OS_POSIX) |
| 70 #include <signal.h> | 70 #include <signal.h> |
| 71 | 71 |
| 72 #include "base/global_descriptors_posix.h" | 72 #include "base/global_descriptors_posix.h" |
| 73 #include "content/public/common/content_descriptors.h" | 73 #include "content/public/common/content_descriptors.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 | 603 |
| 604 // Enable startup tracing asap to avoid early TRACE_EVENT calls being | 604 // Enable startup tracing asap to avoid early TRACE_EVENT calls being |
| 605 // ignored. | 605 // ignored. |
| 606 if (command_line.HasSwitch(switches::kTraceStartup)) { | 606 if (command_line.HasSwitch(switches::kTraceStartup)) { |
| 607 base::debug::TraceLog::GetInstance()->SetEnabled( | 607 base::debug::TraceLog::GetInstance()->SetEnabled( |
| 608 command_line.GetSwitchValueASCII(switches::kTraceStartup)); | 608 command_line.GetSwitchValueASCII(switches::kTraceStartup)); |
| 609 } | 609 } |
| 610 | 610 |
| 611 #if defined(OS_MACOSX) && !defined(OS_IOS) | 611 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 612 // We need to allocate the IO Ports before the Sandbox is initialized or | 612 // We need to allocate the IO Ports before the Sandbox is initialized or |
| 613 // the first instance of SystemMonitor is created. | 613 // the first instance of PowerStateManager is created. |
| 614 // It's important not to allocate the ports for processes which don't | 614 // It's important not to allocate the ports for processes which don't |
| 615 // register with the system monitor - see crbug.com/88867. | 615 // register with the system monitor - see crbug.com/88867. |
| 616 if (process_type.empty() || | 616 if (process_type.empty() || |
| 617 process_type == switches::kPluginProcess || | 617 process_type == switches::kPluginProcess || |
| 618 process_type == switches::kRendererProcess || | 618 process_type == switches::kRendererProcess || |
| 619 process_type == switches::kUtilityProcess || | 619 process_type == switches::kUtilityProcess || |
| 620 process_type == switches::kWorkerProcess || | 620 process_type == switches::kWorkerProcess || |
| 621 (delegate && | 621 (delegate && |
| 622 delegate->ProcessRegistersWithSystemProcess(process_type))) { | 622 delegate->ProcessRegistersWithSystemProcess(process_type))) { |
| 623 base::SystemMonitor::AllocateSystemIOPorts(); | 623 base::PowerStateManager::AllocateSystemIOPorts(); |
| 624 } | 624 } |
| 625 | 625 |
| 626 if (!process_type.empty() && | 626 if (!process_type.empty() && |
| 627 (!delegate || delegate->ShouldSendMachPort(process_type))) { | 627 (!delegate || delegate->ShouldSendMachPort(process_type))) { |
| 628 SendTaskPortToParentProcess(); | 628 SendTaskPortToParentProcess(); |
| 629 } | 629 } |
| 630 #elif defined(OS_WIN) | 630 #elif defined(OS_WIN) |
| 631 // This must be done early enough since some helper functions like | 631 // This must be done early enough since some helper functions like |
| 632 // IsTouchEnanbled, needed to load resources, may call into the theme dll. | 632 // IsTouchEnanbled, needed to load resources, may call into the theme dll. |
| 633 EnableThemeSupportOnAllWindowStations(); | 633 EnableThemeSupportOnAllWindowStations(); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 | 781 |
| 782 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 782 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
| 783 }; | 783 }; |
| 784 | 784 |
| 785 // static | 785 // static |
| 786 ContentMainRunner* ContentMainRunner::Create() { | 786 ContentMainRunner* ContentMainRunner::Create() { |
| 787 return new ContentMainRunnerImpl(); | 787 return new ContentMainRunnerImpl(); |
| 788 } | 788 } |
| 789 | 789 |
| 790 } // namespace content | 790 } // namespace content |
| OLD | NEW |