The deprecated SharedMemoryHandle is used across several classes. There are two types of audio streams: input and output. They should be converted into ReadOnly and Unsafe regions correspondingly.
There are a producer and a client of audio steams for both input and output. It's possible to make this conversion gradually, modifying one side of the mojo communication channel after another. The main producer classes are AudioInputSyncWriter and AudioSyncReader. I'm proposing to start this change from them.
There is one inconvenient moment on the consumer side: AudioDeviceThread::Callback is a base class for Audio{Output,Input}Device::AudioThreadCallback that holds a shared memory that should be read-only or writable depending on whether it's output or input device. This class structure should be refactored because in the new shmem API read-only and writable shared memory are represented by different classes.
Comment 1 by alexilin@chromium.org
, May 22 2018