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