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

Unified Diff: content/browser/in_process_io_surface_manager_mac.h

Issue 1120873002: Re-land: content: Single process support for native GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dm-browsertests-refactor
Patch Set: disable test for now Created 5 years, 6 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 | « content/browser/browser_main_loop.cc ('k') | content/browser/in_process_io_surface_manager_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/in_process_io_surface_manager_mac.h
diff --git a/content/browser/in_process_io_surface_manager_mac.h b/content/browser/in_process_io_surface_manager_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..1ace534b7cba705224c19ed039626cbcba2ea589
--- /dev/null
+++ b/content/browser/in_process_io_surface_manager_mac.h
@@ -0,0 +1,46 @@
+// 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_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_
+#define CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_
+
+#include "base/containers/scoped_ptr_hash_map.h"
+#include "base/mac/scoped_mach_port.h"
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/singleton.h"
+#include "base/synchronization/lock.h"
+#include "content/common/content_export.h"
+#include "content/common/mac/io_surface_manager.h"
+
+namespace content {
+
+class CONTENT_EXPORT InProcessIOSurfaceManager : public IOSurfaceManager {
+ public:
+ static InProcessIOSurfaceManager* 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;
+
+ private:
+ friend struct DefaultSingletonTraits<InProcessIOSurfaceManager>;
+
+ InProcessIOSurfaceManager();
+ ~InProcessIOSurfaceManager() override;
+
+ using IOSurfaceMap =
+ base::ScopedPtrHashMap<int, scoped_ptr<base::mac::ScopedMachSendRight>>;
+ IOSurfaceMap io_surfaces_;
+ base::Lock lock_;
+
+ DISALLOW_COPY_AND_ASSIGN(InProcessIOSurfaceManager);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/in_process_io_surface_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698