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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 if (process_type.empty() || | 659 if (process_type.empty() || |
658 (delegate_ && | 660 (delegate_ && |
659 delegate_->ProcessRegistersWithSystemProcess(process_type))) { | 661 delegate_->ProcessRegistersWithSystemProcess(process_type))) { |
660 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); | 662 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); |
661 } | 663 } |
662 | 664 |
663 if (!process_type.empty() && | 665 if (!process_type.empty() && |
664 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { | 666 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { |
665 MachBroker::ChildSendTaskPortToParent(); | 667 MachBroker::ChildSendTaskPortToParent(); |
666 } | 668 } |
| 669 |
| 670 if (!command_line.HasSwitch(switches::kSingleProcess) && |
| 671 !process_type.empty() && (process_type == switches::kRendererProcess || |
| 672 process_type == switches::kGpuProcess)) { |
| 673 mach_port_t service_port = |
| 674 BrowserIOSurfaceManager::LookupServicePort(getppid()); |
| 675 if (service_port != MACH_PORT_NULL) { |
| 676 ChildIOSurfaceManager::GetInstance()->set_service_port(service_port); |
| 677 IOSurfaceManager::SetInstance(ChildIOSurfaceManager::GetInstance()); |
| 678 } |
| 679 } |
667 #elif defined(OS_WIN) | 680 #elif defined(OS_WIN) |
668 SetupCRT(command_line); | 681 SetupCRT(command_line); |
669 #endif | 682 #endif |
670 | 683 |
671 #if defined(OS_POSIX) | 684 #if defined(OS_POSIX) |
672 if (!process_type.empty()) { | 685 if (!process_type.empty()) { |
673 // When you hit Ctrl-C in a terminal running the browser | 686 // When you hit Ctrl-C in a terminal running the browser |
674 // process, a SIGINT is delivered to the entire process group. | 687 // process, a SIGINT is delivered to the entire process group. |
675 // When debugging the browser process via gdb, gdb catches the | 688 // When debugging the browser process via gdb, gdb catches the |
676 // 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... |
847 | 860 |
848 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 861 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
849 }; | 862 }; |
850 | 863 |
851 // static | 864 // static |
852 ContentMainRunner* ContentMainRunner::Create() { | 865 ContentMainRunner* ContentMainRunner::Create() { |
853 return new ContentMainRunnerImpl(); | 866 return new ContentMainRunnerImpl(); |
854 } | 867 } |
855 | 868 |
856 } // namespace content | 869 } // namespace content |
OLD | NEW |