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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 #include "base/strings/string_number_conversions.h" | 80 #include "base/strings/string_number_conversions.h" |
81 #include "base/trace_event/trace_event_etw_export_win.h" | 81 #include "base/trace_event/trace_event_etw_export_win.h" |
82 #include "ui/base/win/atl_module.h" | 82 #include "ui/base/win/atl_module.h" |
83 #include "ui/gfx/win/dpi.h" | 83 #include "ui/gfx/win/dpi.h" |
84 #elif defined(OS_MACOSX) | 84 #elif defined(OS_MACOSX) |
85 #include "base/mac/scoped_nsautorelease_pool.h" | 85 #include "base/mac/scoped_nsautorelease_pool.h" |
86 #if !defined(OS_IOS) | 86 #if !defined(OS_IOS) |
87 #include "base/power_monitor/power_monitor_device_source.h" | 87 #include "base/power_monitor/power_monitor_device_source.h" |
88 #include "content/app/mac/mac_init.h" | 88 #include "content/app/mac/mac_init.h" |
| 89 #include "content/browser/browser_io_surface_manager_mac.h" |
89 #include "content/browser/mach_broker_mac.h" | 90 #include "content/browser/mach_broker_mac.h" |
| 91 #include "content/child/child_io_surface_manager_mac.h" |
90 #include "content/common/sandbox_init_mac.h" | 92 #include "content/common/sandbox_init_mac.h" |
91 #endif // !OS_IOS | 93 #endif // !OS_IOS |
92 #endif // OS_WIN | 94 #endif // OS_WIN |
93 | 95 |
94 #if defined(OS_POSIX) | 96 #if defined(OS_POSIX) |
95 #include <signal.h> | 97 #include <signal.h> |
96 | 98 |
97 #include "base/posix/global_descriptors.h" | 99 #include "base/posix/global_descriptors.h" |
98 #include "content/public/common/content_descriptors.h" | 100 #include "content/public/common/content_descriptors.h" |
99 | 101 |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 if (process_type.empty() || | 658 if (process_type.empty() || |
657 (delegate_ && | 659 (delegate_ && |
658 delegate_->ProcessRegistersWithSystemProcess(process_type))) { | 660 delegate_->ProcessRegistersWithSystemProcess(process_type))) { |
659 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); | 661 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); |
660 } | 662 } |
661 | 663 |
662 if (!process_type.empty() && | 664 if (!process_type.empty() && |
663 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { | 665 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { |
664 MachBroker::ChildSendTaskPortToParent(); | 666 MachBroker::ChildSendTaskPortToParent(); |
665 } | 667 } |
| 668 |
| 669 if (!command_line.HasSwitch(switches::kSingleProcess) && |
| 670 !process_type.empty() && (process_type == switches::kRendererProcess || |
| 671 process_type == switches::kGpuProcess)) { |
| 672 base::mac::ScopedMachSendRight service_port = |
| 673 BrowserIOSurfaceManager::LookupServicePort(getppid()); |
| 674 if (service_port.is_valid()) { |
| 675 ChildIOSurfaceManager::GetInstance()->set_service_port( |
| 676 service_port.release()); |
| 677 IOSurfaceManager::SetInstance(ChildIOSurfaceManager::GetInstance()); |
| 678 } |
| 679 } |
666 #elif defined(OS_WIN) | 680 #elif defined(OS_WIN) |
667 SetupCRT(command_line); | 681 SetupCRT(command_line); |
668 #endif | 682 #endif |
669 | 683 |
670 #if defined(OS_POSIX) | 684 #if defined(OS_POSIX) |
671 if (!process_type.empty()) { | 685 if (!process_type.empty()) { |
672 // When you hit Ctrl-C in a terminal running the browser | 686 // When you hit Ctrl-C in a terminal running the browser |
673 // process, a SIGINT is delivered to the entire process group. | 687 // process, a SIGINT is delivered to the entire process group. |
674 // When debugging the browser process via gdb, gdb catches the | 688 // When debugging the browser process via gdb, gdb catches the |
675 // SIGINT for the browser process (and dumps you back to the gdb | 689 // SIGINT for the browser process (and dumps you back to the gdb |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 | 860 |
847 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 861 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
848 }; | 862 }; |
849 | 863 |
850 // static | 864 // static |
851 ContentMainRunner* ContentMainRunner::Create() { | 865 ContentMainRunner* ContentMainRunner::Create() { |
852 return new ContentMainRunnerImpl(); | 866 return new ContentMainRunnerImpl(); |
853 } | 867 } |
854 | 868 |
855 } // namespace content | 869 } // namespace content |
OLD | NEW |