Ensure that data is not overwritten in the audio input shared memory ring buffer that sits on the browser/renderer boundary.

This is for "low-latency" audio input streams only.

* The reading side (renderer) signals back to the writing side over the socket that it has read a buffer.
* The writing side receives the verifications and checks that there is room in the ring buffer before writing so that no data is overwritten.
* If the ring buffer is full, log error and drop the data.
* Report UMA stats of how many drops we had when the audio input stream is destroyed.
* Make SyncSocket::Peek virtual to be able to override in test mocks.
* Some refactoring of AudioInputSyncWriter to be able to test it.
* Add a new unit test for AudioInputSyncWriter.

BUG=523224
NOTRY=true

Review URL: https://codereview.chromium.org/1302423006

Cr-Commit-Position: refs/heads/master@{#348156}


CrOS-Libchrome-Original-Commit: 8d9071da52c70d300bfc0cdc0448c564b39764f4
1 file changed
tree: 83a75f492d9e4be0a7f45a1bc29bb908423395d7
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/