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_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ |
| 6 #define CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ |
| 7 |
| 8 #include "base/containers/scoped_ptr_hash_map.h" |
| 9 #include "base/mac/scoped_mach_port.h" |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/singleton.h" |
| 13 #include "base/synchronization/lock.h" |
| 14 #include "content/common/mac/io_surface_manager.h" |
| 15 |
| 16 namespace content { |
| 17 |
| 18 class CONTENT_EXPORT InProcessIOSurfaceManager : public IOSurfaceManager { |
| 19 public: |
| 20 static InProcessIOSurfaceManager* GetInstance(); |
| 21 |
| 22 // Overridden from IOSurfaceManager: |
| 23 bool RegisterIOSurface(int io_surface_id, |
| 24 int client_id, |
| 25 IOSurfaceRef io_surface) override; |
| 26 void UnregisterIOSurface(int io_surface_id, int client_id) override; |
| 27 IOSurfaceRef AcquireIOSurface(int io_surface_id) override; |
| 28 |
| 29 private: |
| 30 friend struct DefaultSingletonTraits<InProcessIOSurfaceManager>; |
| 31 |
| 32 InProcessIOSurfaceManager(); |
| 33 ~InProcessIOSurfaceManager() override; |
| 34 |
| 35 using IOSurfaceMap = |
| 36 base::ScopedPtrHashMap<int, scoped_ptr<base::mac::ScopedMachSendRight>>; |
| 37 IOSurfaceMap io_surfaces_; |
| 38 base::Lock lock_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(InProcessIOSurfaceManager); |
| 41 }; |
| 42 |
| 43 } // namespace content |
| 44 |
| 45 #endif // CONTENT_BROWSER_IN_PROCESS_IO_SURFACE_MANAGER_MAC_H_ |
OLD | NEW |