Bug 1537940 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The call that prevents Activity Monitor from labeling content processes as "Not Responding" is CGSShutdownServerConnections(). Now that we've disabled the native event loop (bug 1426100), we need to call CGSShutdownServerConnections() regardless of whether or not the sandbox is enabled.

We normally call that from ContentChild.cpp:StartMacOSContentSandbox(), but when the sandbox is disabled, 1) StartMacOSContentSandbox() is not called because the parent doesn't send the SetProcessSandbox message and 2) we return early from StartMacOSContentSandbox() so it wouldn't be called anyway.

From ContentChild.cpp,

  static bool StartMacOSContentSandbox() {
    int sandboxLevel = GetEffectiveContentSandboxLevel();
    if (sandboxLevel < 1) {
      return false;
    }

    // Close all current connections to the WindowServer. This ensures that the
    // Activity Monitor will not label the content process as "Not responding"
    // because it's not running a native event loop. See bug 1384336.
    CGSShutdownServerConnections();
The call that prevents Activity Monitor from labeling content processes as "Not Responding" is CGSShutdownServerConnections(). Now that we've disabled the native event loop (bug 1426100), we need to call CGSShutdownServerConnections() regardless of whether or not the sandbox is enabled.

We normally call that from ContentChild.cpp:StartMacOSContentSandbox(), but when the sandbox is disabled, 1) StartMacOSContentSandbox() is not called because the parent doesn't send the SetProcessSandbox message and 2) we return early from StartMacOSContentSandbox() so it wouldn't be called anyway.

From ContentChild.cpp,
````
  static bool StartMacOSContentSandbox() {
    int sandboxLevel = GetEffectiveContentSandboxLevel();
    if (sandboxLevel < 1) {
      return false;
    }

    // Close all current connections to the WindowServer. This ensures that the
    // Activity Monitor will not label the content process as "Not responding"
    // because it's not running a native event loop. See bug 1384336.
    CGSShutdownServerConnections();
````

Back to Bug 1537940 Comment 1