| 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_BROWSER_IO_SURFACE_MANAGER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_IO_SURFACE_MANAGER_MAC_H_ |
| 6 #define CONTENT_BROWSER_BROWSER_IO_SURFACE_MANAGER_MAC_H_ | 6 #define CONTENT_BROWSER_BROWSER_IO_SURFACE_MANAGER_MAC_H_ |
| 7 | 7 |
| 8 #include <mach/mach.h> | 8 #include <mach/mach.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 // Generate a unique unguessable token that the child process associated | 60 // Generate a unique unguessable token that the child process associated |
| 61 // |child_process_id| can use to acquire IOSurface references. | 61 // |child_process_id| can use to acquire IOSurface references. |
| 62 IOSurfaceManagerToken GenerateChildProcessToken(int child_process_id); | 62 IOSurfaceManagerToken GenerateChildProcessToken(int child_process_id); |
| 63 | 63 |
| 64 // Invalidate a previously generated child process token. | 64 // Invalidate a previously generated child process token. |
| 65 void InvalidateChildProcessToken(const IOSurfaceManagerToken& token); | 65 void InvalidateChildProcessToken(const IOSurfaceManagerToken& token); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 friend class BrowserIOSurfaceManagerTest; | 68 friend class BrowserIOSurfaceManagerTest; |
| 69 friend struct DefaultSingletonTraits<BrowserIOSurfaceManager>; | 69 friend struct base::DefaultSingletonTraits<BrowserIOSurfaceManager>; |
| 70 | 70 |
| 71 BrowserIOSurfaceManager(); | 71 BrowserIOSurfaceManager(); |
| 72 ~BrowserIOSurfaceManager() override; | 72 ~BrowserIOSurfaceManager() override; |
| 73 | 73 |
| 74 // Performs any initialization work. | 74 // Performs any initialization work. |
| 75 bool Initialize(); | 75 bool Initialize(); |
| 76 | 76 |
| 77 // Message handler that is invoked on |dispatch_source_| when an | 77 // Message handler that is invoked on |dispatch_source_| when an |
| 78 // incoming message needs to be received. | 78 // incoming message needs to be received. |
| 79 void HandleRequest(); | 79 void HandleRequest(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // Mutex that guards |initialized_|, |io_surfaces_|, |child_process_ids_| | 116 // Mutex that guards |initialized_|, |io_surfaces_|, |child_process_ids_| |
| 117 // and |gpu_process_token_|. | 117 // and |gpu_process_token_|. |
| 118 base::Lock lock_; | 118 base::Lock lock_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(BrowserIOSurfaceManager); | 120 DISALLOW_COPY_AND_ASSIGN(BrowserIOSurfaceManager); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace content | 123 } // namespace content |
| 124 | 124 |
| 125 #endif // CONTENT_BROWSER_BROWSER_IO_SURFACE_MANAGER_MAC_H_ | 125 #endif // CONTENT_BROWSER_BROWSER_IO_SURFACE_MANAGER_MAC_H_ |
| OLD | NEW |