OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 PPAPI_SHAERD_IMPL_VPN_PROVIDER_UTIL_H_ |
| 6 #define PPAPI_SHAERD_IMPL_VPN_PROVIDER_UTIL_H_ |
| 7 |
| 8 #include "base/memory/shared_memory.h" |
| 9 |
| 10 namespace ppapi { |
| 11 |
| 12 class VpnProviderSharedBuffer { |
| 13 public: |
| 14 VpnProviderSharedBuffer(uint32_t capacity, |
| 15 uint32_t packet_size, |
| 16 std::unique_ptr<base::SharedMemory> shm); |
| 17 ~VpnProviderSharedBuffer(); |
| 18 |
| 19 bool GetAvailable(uint32_t* id); |
| 20 void SetAvailable(uint32_t id, bool value); |
| 21 void* GetBuffer(uint32_t id); |
| 22 base::SharedMemoryHandle GetHandle(); |
| 23 |
| 24 private: |
| 25 uint32_t capacity_; |
| 26 uint32_t packet_size_; |
| 27 std::unique_ptr<base::SharedMemory> shm_; |
| 28 std::unique_ptr<bool[]> available_; |
| 29 }; |
| 30 |
| 31 } // namespace ppapi |
| 32 |
| 33 #endif // PPAPI_SHAERD_IMPL_VPN_PROVIDER_UTIL_H_ |
OLD | NEW |