summaryrefslogtreecommitdiffstats
path: root/remoting/base/shared_buffer_factory.h
blob: bd10a4be457455a15a83be56f6903baab3712fab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_BASE_SHARED_BUFFER_FACTORY_H_
#define REMOTING_BASE_SHARED_BUFFER_FACTORY_H_

namespace remoting {

class SharedBuffer;

// Provides a way to create shared buffers accessible by two or more processes.
class SharedBufferFactory {
 public:
  virtual ~SharedBufferFactory() {}

  // Creates a shared memory buffer of the given size.
  virtual scoped_refptr<SharedBuffer> CreateSharedBuffer(uint32 size) = 0;

  // Notifies the factory that the buffer is no longer used by the caller and
  // can be released. The caller still has to drop all references to free
  // the memory.
  virtual void ReleaseSharedBuffer(scoped_refptr<SharedBuffer> buffer) = 0;
};

}  // namespace remoting

#endif  // REMOTING_BASE_SHARED_BUFFER_FACTORY_H_