Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: content/app/content_main_runner.cc

Issue 1532813002: Replace IOSurfaceManager by directly passing IOSurface Mach ports over Chrome IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compile Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 9 #include <string>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 #include "base/trace_event/trace_event_etw_export_win.h" 80 #include "base/trace_event/trace_event_etw_export_win.h"
81 #include "base/win/process_startup_helper.h" 81 #include "base/win/process_startup_helper.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"
90 #include "content/browser/mach_broker_mac.h" 89 #include "content/browser/mach_broker_mac.h"
91 #include "content/child/child_io_surface_manager_mac.h"
92 #include "content/common/sandbox_init_mac.h" 90 #include "content/common/sandbox_init_mac.h"
93 #endif // !OS_IOS 91 #endif // !OS_IOS
94 #endif // OS_WIN 92 #endif // OS_WIN
95 93
96 #if defined(OS_POSIX) 94 #if defined(OS_POSIX)
97 #include <signal.h> 95 #include <signal.h>
98 96
99 #include "base/posix/global_descriptors.h" 97 #include "base/posix/global_descriptors.h"
100 #include "content/public/common/content_descriptors.h" 98 #include "content/public/common/content_descriptors.h"
101 99
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 if (process_type.empty() || 644 if (process_type.empty() ||
647 (delegate_ && 645 (delegate_ &&
648 delegate_->ProcessRegistersWithSystemProcess(process_type))) { 646 delegate_->ProcessRegistersWithSystemProcess(process_type))) {
649 base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); 647 base::PowerMonitorDeviceSource::AllocateSystemIOPorts();
650 } 648 }
651 649
652 if (!process_type.empty() && 650 if (!process_type.empty() &&
653 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) { 651 (!delegate_ || delegate_->ShouldSendMachPort(process_type))) {
654 MachBroker::ChildSendTaskPortToParent(); 652 MachBroker::ChildSendTaskPortToParent();
655 } 653 }
656
657 if (!command_line.HasSwitch(switches::kSingleProcess) &&
658 !process_type.empty() && (process_type == switches::kRendererProcess ||
659 process_type == switches::kGpuProcess)) {
660 base::mac::ScopedMachSendRight service_port =
661 BrowserIOSurfaceManager::LookupServicePort(getppid());
662 if (service_port.is_valid()) {
663 ChildIOSurfaceManager::GetInstance()->set_service_port(
664 service_port.release());
665 gfx::IOSurfaceManager::SetInstance(
666 ChildIOSurfaceManager::GetInstance());
667 }
668 }
669 #elif defined(OS_WIN) 654 #elif defined(OS_WIN)
670 base::win::SetupCRT(command_line); 655 base::win::SetupCRT(command_line);
671 #endif 656 #endif
672 657
673 #if defined(OS_POSIX) 658 #if defined(OS_POSIX)
674 if (!process_type.empty()) { 659 if (!process_type.empty()) {
675 // When you hit Ctrl-C in a terminal running the browser 660 // When you hit Ctrl-C in a terminal running the browser
676 // process, a SIGINT is delivered to the entire process group. 661 // process, a SIGINT is delivered to the entire process group.
677 // When debugging the browser process via gdb, gdb catches the 662 // When debugging the browser process via gdb, gdb catches the
678 // SIGINT for the browser process (and dumps you back to the gdb 663 // SIGINT for the browser process (and dumps you back to the gdb
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 840
856 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl); 841 DISALLOW_COPY_AND_ASSIGN(ContentMainRunnerImpl);
857 }; 842 };
858 843
859 // static 844 // static
860 ContentMainRunner* ContentMainRunner::Create() { 845 ContentMainRunner* ContentMainRunner::Create() {
861 return new ContentMainRunnerImpl(); 846 return new ContentMainRunnerImpl();
862 } 847 }
863 848
864 } // namespace content 849 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698