diff options
| author | 2018-10-19 14:42:45 -0700 | |
|---|---|---|
| committer | 2018-10-30 12:58:20 -0700 | |
| commit | d94e2ee6a960c2163f87dedd406424a916ea553c (patch) | |
| tree | 15a4e00a4364a039dbea84cdb111acb85df295f0 /libs/ui/BufferHubBuffer.cpp | |
| parent | 27631c9c42e8cfbfd7b42d60818b7954dcfbbc1e (diff) | |
Add duplicate to BufferClient
Calling BufferClient::duplicate() will now return you an uint64_t token
stands for a specific BufferNode. In later CLs users could pass this
IPC-friendly token everywhere and use it to create a IBufferClient
linked to that BufferNode.
The token is derived from the mt19936_64 random algorithm. No same
tokens will be generated at the same time by checking the token_map_.
The map holds a weak_ptr so that if the BufferNode goes away by some
reason the map will not keep it, preventing from memory leak.
Add test case to test on the function.
Test: "atest buffer_hub_binder_service-test" passed.
Bug: 116681016
Change-Id: I54c34d9fabe882326faa141a6f0691419b740694
Diffstat (limited to 'libs/ui/BufferHubBuffer.cpp')
0 files changed, 0 insertions, 0 deletions