OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 REMOTING_BASE_SHARED_BUFFER_FACTORY_H_ | 5 #ifndef REMOTING_CAPTURER_SHARED_BUFFER_FACTORY_H_ |
6 #define REMOTING_BASE_SHARED_BUFFER_FACTORY_H_ | 6 #define REMOTING_CAPTURER_SHARED_BUFFER_FACTORY_H_ |
7 | 7 |
8 namespace remoting { | 8 namespace remoting { |
9 | 9 |
10 class SharedBuffer; | 10 class SharedBuffer; |
11 | 11 |
12 // Provides a way to create shared buffers accessible by two or more processes. | 12 // Provides a way to create shared buffers accessible by two or more processes. |
13 class SharedBufferFactory { | 13 class SharedBufferFactory { |
14 public: | 14 public: |
15 virtual ~SharedBufferFactory() {} | 15 virtual ~SharedBufferFactory() {} |
16 | 16 |
17 // Creates a shared memory buffer of the given size. | 17 // Creates a shared memory buffer of the given size. |
18 virtual scoped_refptr<SharedBuffer> CreateSharedBuffer(uint32 size) = 0; | 18 virtual scoped_refptr<SharedBuffer> CreateSharedBuffer(uint32 size) = 0; |
19 | 19 |
20 // Notifies the factory that the buffer is no longer used by the caller and | 20 // Notifies the factory that the buffer is no longer used by the caller and |
21 // can be released. The caller still has to drop all references to free | 21 // can be released. The caller still has to drop all references to free |
22 // the memory. | 22 // the memory. |
23 virtual void ReleaseSharedBuffer(scoped_refptr<SharedBuffer> buffer) = 0; | 23 virtual void ReleaseSharedBuffer(scoped_refptr<SharedBuffer> buffer) = 0; |
24 }; | 24 }; |
25 | 25 |
26 } // namespace remoting | 26 } // namespace remoting |
27 | 27 |
28 #endif // REMOTING_BASE_SHARED_BUFFER_FACTORY_H_ | 28 #endif // REMOTING_CAPTURER_SHARED_BUFFER_FACTORY_H_ |
OLD | NEW |