| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ |
| 6 #define CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ |
| 7 | 7 |
| 8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
| 9 #include "base/mac/scoped_mach_port.h" | 9 #include "base/mac/scoped_mach_port.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 static InProcessIOSurfaceManager* GetInstance(); | 21 static InProcessIOSurfaceManager* GetInstance(); |
| 22 | 22 |
| 23 // Overridden from IOSurfaceManager: | 23 // Overridden from IOSurfaceManager: |
| 24 bool RegisterIOSurface(IOSurfaceId io_surface_id, | 24 bool RegisterIOSurface(IOSurfaceId io_surface_id, |
| 25 int client_id, | 25 int client_id, |
| 26 IOSurfaceRef io_surface) override; | 26 IOSurfaceRef io_surface) override; |
| 27 void UnregisterIOSurface(IOSurfaceId io_surface_id, int client_id) override; | 27 void UnregisterIOSurface(IOSurfaceId io_surface_id, int client_id) override; |
| 28 IOSurfaceRef AcquireIOSurface(IOSurfaceId io_surface_id) override; | 28 IOSurfaceRef AcquireIOSurface(IOSurfaceId io_surface_id) override; |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 friend struct DefaultSingletonTraits<InProcessIOSurfaceManager>; | 31 friend struct base::DefaultSingletonTraits<InProcessIOSurfaceManager>; |
| 32 | 32 |
| 33 InProcessIOSurfaceManager(); | 33 InProcessIOSurfaceManager(); |
| 34 ~InProcessIOSurfaceManager() override; | 34 ~InProcessIOSurfaceManager() override; |
| 35 | 35 |
| 36 using IOSurfaceMap = | 36 using IOSurfaceMap = |
| 37 base::ScopedPtrHashMap<IOSurfaceId, | 37 base::ScopedPtrHashMap<IOSurfaceId, |
| 38 scoped_ptr<base::mac::ScopedMachSendRight>>; | 38 scoped_ptr<base::mac::ScopedMachSendRight>>; |
| 39 IOSurfaceMap io_surfaces_; | 39 IOSurfaceMap io_surfaces_; |
| 40 base::Lock lock_; | 40 base::Lock lock_; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(InProcessIOSurfaceManager); | 42 DISALLOW_COPY_AND_ASSIGN(InProcessIOSurfaceManager); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace content | 45 } // namespace content |
| 46 | 46 |
| 47 #endif // CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ | 47 #endif // CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ |
| OLD | NEW |