ca00dc7ae419c9af239ba21222d7d3d929c0890c
(This is a merge of http://go/wvgerrit/70667) Request ID Index generation has historically worked by incrementing a shared variable in one place and reading it in another place and trusting the fact that CdmLicense calls these operations in a certain order and only once per session to give each session a unique value. This patch cleans this up a bit, having each session store the current Request ID Index at the same time as it stores its Request ID Base. This guarantees that each CryptoSession will receive a unique but stable combination of Base and ID rather than relying on the calling pattern. Since all this generation happens during the same function, the full Request ID can be generated up-front and stored, making GenerateRequestId() no longer necessary. This patch also simplifies the threading story around this shared state by using a std::atomic<uint64_t>. Bringing the code that interacts with the shared state together into one place and replacing it with atomic operations will simplify locking around this code when CryptoSession locking is revamped in a future patch. Bug: 70889998 Bug: 118584039 Test: CE CDM Unit Tests Test: Android Unit Tests Change-Id: I12d2f6501f872f1973e5a9af5125ca03f23e5a56
Description
No description provided