Files
android/libwvdrmengine
John W. Bruce ca00dc7ae4 Simplify How Request ID Indices are Generated
(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
2019-01-23 09:52:46 -08:00
..
2019-01-07 10:14:25 -08:00
2019-01-15 00:24:52 -08:00
2019-01-15 00:24:52 -08:00
2019-01-16 11:06:55 -08:00
2018-04-16 16:38:05 -07:00
2019-01-15 00:24:52 -08:00
2019-01-15 16:46:14 -08:00
2018-11-22 00:33:30 +00:00

This is the source code for the Widevine Content Decryption Module (CDM) for the
Android OS.  It provides the libwvdrmengine plugin for DRM.

Partners who are integrating a device should be familiar with the documents in
the docs directory.

This source code is NOT open source, and is not part of AOSP.  However, it is
released to partners external to Google after official Android releases.  For
this reason, partners should look for bug fixes and software updates on the
widevine branches:

+------------------------------+------------------------------+
|Android Version               |Branch                        |
+------------------------------+------------------------------+
|Android L                     |lmp-mr1-widevine-release      |
+------------------------------+------------------------------+
|Android M MR1                 |mnc-mr1-widevine-release      |
+------------------------------+------------------------------+
|Android N MR2                 |nyc-mr2-widevine-release      |
+------------------------------+------------------------------+
|Android OC                    |oc-widevine-release           |
+------------------------------+------------------------------+
|Android OC MR1                |oc-mr1-widevine-release       |
+------------------------------+------------------------------+
|Android Pi                    |pi-widevine-release           |
+------------------------------+------------------------------+