OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_MAC_IO_SURFACE_MANAGER_H_ |
| 6 #define CONTENT_COMMON_MAC_IO_SURFACE_MANAGER_H_ |
| 7 |
| 8 #include <IOSurface/IOSurfaceAPI.h> |
| 9 |
| 10 #include "content/common/content_export.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 // This interface provides a mechanism for different processes to securely |
| 15 // share IOSurfaces. A process can register an IOSurface for use in another |
| 16 // process and the client ID provided with registration determines the process |
| 17 // that can acquire a reference to the IOSurface. |
| 18 class CONTENT_EXPORT IOSurfaceManager { |
| 19 public: |
| 20 static IOSurfaceManager* GetInstance(); |
| 21 static void SetInstance(IOSurfaceManager* instance); |
| 22 |
| 23 // Register an IO surface for use in another process. |
| 24 virtual bool RegisterIOSurface(int io_surface_id, |
| 25 int client_id, |
| 26 IOSurfaceRef io_surface) = 0; |
| 27 |
| 28 // Unregister an IO surface previously registered for use in another |
| 29 // process. |
| 30 virtual void UnregisterIOSurface(int io_surface_id, int client_id) = 0; |
| 31 |
| 32 // Acquire IO surface reference for a registered IO surface. |
| 33 virtual IOSurfaceRef AcquireIOSurface(int io_surface_id) = 0; |
| 34 |
| 35 protected: |
| 36 virtual ~IOSurfaceManager() {} |
| 37 }; |
| 38 |
| 39 } // namespace content |
| 40 |
| 41 #endif // CONTENT_COMMON_MAC_IO_SURFACE_MANAGER_H_ |
OLD | NEW |