Index: content/app/content_main_runner.cc |
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc |
index 279536b09b983deec9ae5f22856e5c0bbb72f83a..03335595ec248748abf331f766d747abc780bfed 100644 |
--- a/content/app/content_main_runner.cc |
+++ b/content/app/content_main_runner.cc |
@@ -86,7 +86,9 @@ |
#if !defined(OS_IOS) |
#include "base/power_monitor/power_monitor_device_source.h" |
#include "content/app/mac/mac_init.h" |
+#include "content/browser/browser_io_surface_manager_mac.h" |
#include "content/browser/mach_broker_mac.h" |
+#include "content/child/child_io_surface_manager_mac.h" |
#include "content/common/sandbox_init_mac.h" |
#endif // !OS_IOS |
#endif // OS_WIN |
@@ -664,6 +666,17 @@ class ContentMainRunnerImpl : public ContentMainRunner { |
(!delegate_ || delegate_->ShouldSendMachPort(process_type))) { |
MachBroker::ChildSendTaskPortToParent(); |
} |
+ |
+ if (!command_line.HasSwitch(switches::kSingleProcess) && |
+ !process_type.empty() && (process_type == switches::kRendererProcess || |
+ process_type == switches::kGpuProcess)) { |
+ mach_port_t service_port = |
+ BrowserIOSurfaceManager::LookupServicePort(getppid()); |
+ if (service_port != MACH_PORT_NULL) { |
+ ChildIOSurfaceManager::GetInstance()->set_service_port(service_port); |
+ IOSurfaceManager::SetInstance(ChildIOSurfaceManager::GetInstance()); |
+ } |
+ } |
#elif defined(OS_WIN) |
SetupCRT(command_line); |
#endif |