Chromium Code Reviews
Description[Mac] Replace the existing browser-child mach ipc with a long-lived listener on a well-known port.
Before this CL:
Before fork()ing a child, the browser process creates a mach receive port with a random name. After the fork() but before exec(), the child uses mach ipc to transmit send rights to its task port. The child has access to the random name because it inherits it from the browser process. Unfortunately, some of the library functions involved in sending a mach message are not safe to call after fork().
After this CL:
Before forking the first child, the browser spins off a new thread that listens on a well-known port for mach ipc from any process. This well-known port is "com.google.Chrome.<browserpid>". When a child process starts up, it sends a mach message to its parent browser's well-known port. On the browser side, we listen for said message, extract the pid of the sending process, and ignore any messages from processes we did not personally fork(). This check is necessary because any arbitrary process on the system could send mach ipc to that port.
BUG=35374
TEST=Browser should still start up. The task manager should still show correct cpu/memory data. There should be no perf regressions.
TEST=Mac ui_tests and browser_tests should be less flaky.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=59782
Patch Set 1 #Patch Set 2 : '' #Patch Set 3 : '' #Patch Set 4 : '' #
Total comments: 37
Patch Set 5 : '' #Patch Set 6 : '' #Patch Set 7 : '' #Patch Set 8 : '' #Patch Set 9 : '' #
Total comments: 30
Patch Set 10 : '' #Patch Set 11 : '' #
Total comments: 18
Patch Set 12 : '' #Patch Set 13 : '' #
Total comments: 8
Patch Set 14 : '' #Patch Set 15 : '' #Patch Set 16 : '' #Patch Set 17 : '' #
Total comments: 2
Patch Set 18 : '' #Patch Set 19 : '' #
Messages
Total messages: 12 (0 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||