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(); | |
bbudge
2016/05/17 09:50:12
This doesn't seem to be used yet. It seems undesir
adrian.belgun
2016/05/17 11:05:29
This class is used by both the Resource and the Re
bbudge
2016/05/17 13:34:39
But the host has access to that handle already (to
adrian.belgun
2016/05/17 15:25:29
The issue is that this API is tied to the chrome.v
| |
26 | |
27 private: | |
28 uint32_t capacity_; | |
29 uint32_t packet_size_; | |
30 std::unique_ptr<base::SharedMemory> shm_; | |
31 std::unique_ptr<bool[]> available_; | |
bbudge
2016/05/17 09:50:12
std::vector<bool> is a little tricky to use but sh
adrian.belgun
2016/05/17 11:05:29
Done.
| |
32 }; | |
33 | |
34 } // namespace ppapi | |
35 | |
36 #endif // PPAPI_SHAERD_IMPL_VPN_PROVIDER_UTIL_H_ | |
OLD | NEW |