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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/mach_broker_mac.h" | 89 #include "content/browser/mach_broker_mac.h" |
| 90 #include "content/child/child_io_surface_manager_mac.h" |
90 #include "content/common/sandbox_init_mac.h" | 91 #include "content/common/sandbox_init_mac.h" |
91 #endif // !OS_IOS | 92 #endif // !OS_IOS |
92 #endif // OS_WIN | 93 #endif // OS_WIN |
93 | 94 |
94 #if defined(OS_POSIX) | 95 #if defined(OS_POSIX) |
95 #include <signal.h> | 96 #include <signal.h> |
96 | 97 |
97 #include "base/posix/global_descriptors.h" | 98 #include "base/posix/global_descriptors.h" |
98 #include "content/public/common/content_descriptors.h" | 99 #include "content/public/common/content_descriptors.h" |
99 | 100 |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 if (process_type.empty() || | 658 if (process_type.empty() || |
658 (delegate_ && | 659 (delegate_ && |
659 delegate_->ProcessRegistersWithSystemProcess(process_type))) { | 660 delegate_->ProcessRegistersWithSystemProcess(process_type))) { |
660 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); | 661 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); |
661 } | 662 } |
662 | 663 |
663 if (!process_type.empty() && | 664 if (!process_type.empty() && |
664 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { | 665 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { |
665 MachBroker::ChildSendTaskPortToParent(); | 666 MachBroker::ChildSendTaskPortToParent(); |
666 } | 667 } |
| 668 |
| 669 if (!process_type.empty() && (process_type == switches::kRendererProcess || |
| 670 process_type == switches::kGpuProcess)) { |
| 671 IOSurfaceManager::SetInstance(ChildIOSurfaceManager::GetInstance()); |
| 672 } |
667 #elif defined(OS_WIN) | 673 #elif defined(OS_WIN) |
668 SetupCRT(command_line); | 674 SetupCRT(command_line); |
669 #endif | 675 #endif |
670 | 676 |
671 #if defined(OS_POSIX) | 677 #if defined(OS_POSIX) |
672 if (!process_type.empty()) { | 678 if (!process_type.empty()) { |
673 // When you hit Ctrl-C in a terminal running the browser | 679 // When you hit Ctrl-C in a terminal running the browser |
674 // process, a SIGINT is delivered to the entire process group. | 680 // process, a SIGINT is delivered to the entire process group. |
675 // When debugging the browser process via gdb, gdb catches the | 681 // When debugging the browser process via gdb, gdb catches the |
676 // SIGINT for the browser process (and dumps you back to the gdb | 682 // 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 | 853 |
848 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); | 854 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); |
849 }; | 855 }; |
850 | 856 |
851 // static | 857 // static |
852 ContentMainRunner* ContentMainRunner::Create() { | 858 ContentMainRunner* ContentMainRunner::Create() { |
853 return new ContentMainRunnerImpl(); | 859 return new ContentMainRunnerImpl(); |
854 } | 860 } |
855 | 861 |
856 } // namespace content | 862 } // namespace content |
OLD | NEW |