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

Unified Diff: content/app/content_main_runner.cc

Issue 1137453002: content: Pass IOSurface references using Mach IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcastagna's review Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/child_process_launcher.cc » ('j') | content/browser/mach_broker_mac.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 4c8dcbb99c45b9cf19b2637411e2253892f9d1d4..e275d6f3bfc6429c838aeaec841874c58fe0de8c 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -85,6 +85,7 @@
#if !defined(OS_IOS)
#include "base/power_monitor/power_monitor_device_source.h"
#include "content/browser/mach_broker_mac.h"
+#include "content/common/mac/io_surface_manager.h"
#include "content/common/sandbox_init_mac.h"
#endif // !OS_IOS
#endif // OS_WIN
@@ -125,6 +126,34 @@ extern int UtilityMain(const MainFunctionParams&);
} // namespace content
namespace content {
+namespace {
+
+#if defined(OS_MACOSX) && !defined(OS_IOS)
+class IOSurfaceManagerImpl : public IOSurfaceManager {
Avi (use Gerrit) 2015/05/09 18:00:27 If the MachBroker is basically backing this, put t
reveman 2015/05/09 19:24:23 Ok, I can move this code to mach_broker_mac.cc. Ju
Avi (use Gerrit) 2015/05/09 20:41:01 Then maybe its own file? It just feels weird to be
reveman 2015/05/10 18:45:08 Moved it to mach_broker_mac.cc in latest patch. I
+ public:
+ IOSurfaceManagerImpl() {}
+
+ // Overridden from IOSurfaceManager:
+ bool RegisterIOSurface(int io_surface_id,
+ int client_id,
+ IOSurfaceRef io_surface) override {
+ return MachBroker::ChildRegisterIOSurfaceWithParent(
+ io_surface_id, client_id, IOSurfaceCreateMachPort(io_surface));
+ }
+ void UnregisterIOSurface(int io_surface_id, int client_id) override {
+ MachBroker::ChildUnregisterIOSurfaceWithParent(io_surface_id, client_id);
+ }
+ IOSurfaceRef AcquireIOSurface(int io_surface_id) override {
+ return IOSurfaceLookupFromMachPort(
+ MachBroker::ChildAcquireIOSurfaceFromParent(io_surface_id));
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(IOSurfaceManagerImpl);
+};
+#endif
+
+} // namespace
#if !defined(CHROME_MULTIPLE_DLL_CHILD)
base::LazyInstance<ContentBrowserClient>
@@ -661,6 +690,8 @@ class ContentMainRunnerImpl : public ContentMainRunner {
(!delegate_ || delegate_->ShouldSendMachPort(process_type))) {
MachBroker::ChildSendTaskPortToParent();
}
+
+ IOSurfaceManager::InitInstance(new IOSurfaceManagerImpl);
#elif defined(OS_WIN)
SetupCRT(command_line);
#endif
« no previous file with comments | « no previous file | content/browser/child_process_launcher.cc » ('j') | content/browser/mach_broker_mac.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698