DescriptionFix CrossProcessNotificationMultiProcessTest.Basic on Android.
On Android the ashmem API is used to deal with shared memory. This API doesn't
provide any way to open a memory region created by another process for security
reasons. The only way to share memory on Android is to share the underlying
file descriptor between processes.
This can be accomplished by:
- Creating a new shared memory region in a process. Note that this region can
be anonymous (i.e. the string provided to ashmem_create_region() can be
empty).
- Forking and keeping open both in the parent and child processes the file
descriptor corresponding to the previously created memory region.
- Doing an mmap() in both processes (nothing special here).
The unit test was deadlocking (stuck in the while loop in the child process)
since the call to CreateNamed() wasn't opening the existing shared memory
region (created by the parent process) but was actually creating a new shared
memory region.
This means that the two processes were actually seeing different memory
regions.
Since this also works on POSIX platforms, the unit test was modified to follow
this strategy on all POSIX systems (including Android). On Windows the old
strategy (using non-anonymous shared memory) is still used.
BUG=136720
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=169662
Patch Set 1 : #
Messages
Total messages: 9 (0 generated)
|