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

Unified Diff: content/child/child_io_surface_manager_mac.h

Issue 1137453002: content: Pass IOSurface references using Mach IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, remove extra DCHECKs and fix reply port typo 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
Index: content/child/child_io_surface_manager_mac.h
diff --git a/content/child/child_io_surface_manager_mac.h b/content/child/child_io_surface_manager_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..5be5fabcc7dd2d599a4d4489bc09d5737ed17c3e
--- /dev/null
+++ b/content/child/child_io_surface_manager_mac.h
@@ -0,0 +1,52 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_
+#define CONTENT_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_
+
+#include "base/mac/scoped_mach_port.h"
+#include "base/macros.h"
+#include "base/memory/singleton.h"
+#include "content/common/mac/io_surface_manager.h"
+#include "gpu/command_buffer/common/mailbox.h"
+
+namespace content {
+
+// Implementation of IOSurfaceManager that registers and acquires IOSurfaces
+// through a Mach service.
+class CONTENT_EXPORT ChildIOSurfaceManager : public IOSurfaceManager {
+ public:
+ // Returns the global ChildIOSurfaceManager.
+ static ChildIOSurfaceManager* GetInstance();
+
+ // Overridden from IOSurfaceManager:
+ bool RegisterIOSurface(int io_surface_id,
+ int client_id,
+ IOSurfaceRef io_surface) override;
+ void UnregisterIOSurface(int io_surface_id, int client_id) override;
+ IOSurfaceRef AcquireIOSurface(int io_surface_id) override;
+
+ // Set the service Mach port.
Robert Sesek 2015/05/19 23:26:23 Who's managing the ownership of this port?
reveman 2015/05/27 05:03:18 Used to be the caller but I changed it in latest p
+ void set_service_port(mach_port_t service_port) {
+ service_port_ = service_port;
+ }
+
+ // Set the mailbox used when communicating with the Mach service.
+ void set_mailbox(const gpu::Mailbox& mailbox) { mailbox_ = mailbox; }
+
+ private:
+ friend struct DefaultSingletonTraits<ChildIOSurfaceManager>;
+
+ ChildIOSurfaceManager();
+ ~ChildIOSurfaceManager() override;
+
+ mach_port_t service_port_;
+ gpu::Mailbox mailbox_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChildIOSurfaceManager);
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_CHILD_IO_SURFACE_MANAGER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698