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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <string> | 10 #include <string> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 #include "base/trace_event/trace_event_etw_export_win.h" | 84 #include "base/trace_event/trace_event_etw_export_win.h" |
85 #include "base/win/process_startup_helper.h" | 85 #include "base/win/process_startup_helper.h" |
86 #include "ui/base/win/atl_module.h" | 86 #include "ui/base/win/atl_module.h" |
87 #include "ui/gfx/win/dpi.h" | 87 #include "ui/gfx/win/dpi.h" |
88 #elif defined(OS_MACOSX) | 88 #elif defined(OS_MACOSX) |
89 #include "base/mac/scoped_nsautorelease_pool.h" | 89 #include "base/mac/scoped_nsautorelease_pool.h" |
90 #if !defined(OS_IOS) | 90 #if !defined(OS_IOS) |
91 #include "base/power_monitor/power_monitor_device_source.h" | 91 #include "base/power_monitor/power_monitor_device_source.h" |
92 #include "content/app/mac/mac_init.h" | 92 #include "content/app/mac/mac_init.h" |
93 #include "content/browser/browser_io_surface_manager_mac.h" | |
94 #include "content/browser/mach_broker_mac.h" | 93 #include "content/browser/mach_broker_mac.h" |
95 #include "content/child/child_io_surface_manager_mac.h" | |
96 #include "content/common/sandbox_init_mac.h" | 94 #include "content/common/sandbox_init_mac.h" |
97 #endif // !OS_IOS | 95 #endif // !OS_IOS |
98 #endif // OS_WIN | 96 #endif // OS_WIN |
99 | 97 |
100 #if defined(OS_POSIX) | 98 #if defined(OS_POSIX) |
101 #include <signal.h> | 99 #include <signal.h> |
102 | 100 |
103 #include "base/posix/global_descriptors.h" | 101 #include "base/posix/global_descriptors.h" |
104 #include "content/public/common/content_descriptors.h" | 102 #include "content/public/common/content_descriptors.h" |
105 | 103 |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 if (process_type.empty() || | 643 if (process_type.empty() || |
646 (delegate_ && | 644 (delegate_ && |
647 delegate_->ProcessRegistersWithSystemProcess(process_type))) { | 645 delegate_->ProcessRegistersWithSystemProcess(process_type))) { |
648 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); | 646 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); |
649 } | 647 } |
650 | 648 |
651 if (!process_type.empty() && | 649 if (!process_type.empty() && |
652 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { | 650 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { |
653 MachBroker::ChildSendTaskPortToParent(); | 651 MachBroker::ChildSendTaskPortToParent(); |
654 } | 652 } |
655 | |
656 if (!command_line.HasSwitch(switches::kSingleProcess) && | |
657 !process_type.empty() && (process_type == switches::kRendererProcess || | |
658 process_type == switches::kGpuProcess)) { | |
659 base::mac::ScopedMachSendRight service_port = | |
660 BrowserIOSurfaceManager::LookupServicePort(getppid()); | |
661 if (service_port.is_valid()) { | |
662 ChildIOSurfaceManager::GetInstance()->set_service_port( | |
663 service_port.release()); | |
664 gfx::IOSurfaceManager::SetInstance( | |
665 ChildIOSurfaceManager::GetInstance()); | |
666 } | |
667 } | |
668 #elif defined(OS_WIN) | 653 #elif defined(OS_WIN) |
669 base::win::SetupCRT(command_line); | 654 base::win::SetupCRT(command_line); |
670 #endif | 655 #endif |
671 | 656 |
672 #if defined(OS_POSIX) | 657 #if defined(OS_POSIX) |
673 if (!process_type.empty()) { | 658 if (!process_type.empty()) { |
674 // When you hit Ctrl-C in a terminal running the browser | 659 // When you hit Ctrl-C in a terminal running the browser |
675 // process, a SIGINT is delivered to the entire process group. | 660 // process, a SIGINT is delivered to the entire process group. |
676 // When debugging the browser process via gdb, gdb catches the | 661 // When debugging the browser process via gdb, gdb catches the |
677 // SIGINT for the browser process (and dumps you back to the gdb | 662 // SIGINT for the browser process (and dumps you back to the gdb |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 | 839 |
855 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 840 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
856 }; | 841 }; |
857 | 842 |
858 // static | 843 // static |
859 ContentMainRunner* ContentMainRunner::Create() { | 844 ContentMainRunner* ContentMainRunner::Create() { |
860 return new ContentMainRunnerImpl(); | 845 return new ContentMainRunnerImpl(); |
861 } | 846 } |
862 | 847 |
863 } // namespace content | 848 } // namespace content |
OLD | NEW |