Loading services/bufferhub/BufferHubService.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ Return<void> BufferHubService::importBuffer(const hidl_handle& /*nativeHandle*/, return Void(); } hidl_handle BufferHubService::registerToken(const BufferClient* client) { hidl_handle BufferHubService::registerToken(const wp<BufferClient>& client) { uint32_t token; std::lock_guard<std::mutex> lock(mTokenMapMutex); do { Loading services/bufferhub/include/bufferhub/BufferHubService.h +3 −3 Original line number Diff line number Diff line Loading @@ -46,18 +46,18 @@ public: // Non-binder functions // Internal help function for IBufferClient::duplicate. hidl_handle registerToken(const BufferClient* client); hidl_handle registerToken(const wp<BufferClient>& client); private: // List of active BufferClient for bookkeeping. std::mutex mClientListMutex; std::vector<sp<BufferClient>> mClientList GUARDED_BY(mClientListMutex); std::vector<wp<BufferClient>> mClientList GUARDED_BY(mClientListMutex); // TODO(b/118180214): use a more secure implementation std::mt19937 mTokenEngine; // The mapping from token to the client creates it. std::mutex mTokenMapMutex; std::map<uint32_t, const BufferClient*> mTokenMap GUARDED_BY(mTokenMapMutex); std::map<uint32_t, const wp<BufferClient>> mTokenMap GUARDED_BY(mTokenMapMutex); }; } // namespace implementation Loading Loading
services/bufferhub/BufferHubService.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ Return<void> BufferHubService::importBuffer(const hidl_handle& /*nativeHandle*/, return Void(); } hidl_handle BufferHubService::registerToken(const BufferClient* client) { hidl_handle BufferHubService::registerToken(const wp<BufferClient>& client) { uint32_t token; std::lock_guard<std::mutex> lock(mTokenMapMutex); do { Loading
services/bufferhub/include/bufferhub/BufferHubService.h +3 −3 Original line number Diff line number Diff line Loading @@ -46,18 +46,18 @@ public: // Non-binder functions // Internal help function for IBufferClient::duplicate. hidl_handle registerToken(const BufferClient* client); hidl_handle registerToken(const wp<BufferClient>& client); private: // List of active BufferClient for bookkeeping. std::mutex mClientListMutex; std::vector<sp<BufferClient>> mClientList GUARDED_BY(mClientListMutex); std::vector<wp<BufferClient>> mClientList GUARDED_BY(mClientListMutex); // TODO(b/118180214): use a more secure implementation std::mt19937 mTokenEngine; // The mapping from token to the client creates it. std::mutex mTokenMapMutex; std::map<uint32_t, const BufferClient*> mTokenMap GUARDED_BY(mTokenMapMutex); std::map<uint32_t, const wp<BufferClient>> mTokenMap GUARDED_BY(mTokenMapMutex); }; } // namespace implementation Loading