Chromium Code Reviews| Index: content/common/sandbox_mac.mm |
| diff --git a/content/common/sandbox_mac.mm b/content/common/sandbox_mac.mm |
| index 9ef3e1c6cdcad0f1c44e32102d7912bef2a1225e..4c462007950c347c7264faeff1bd8d70f84b2031 100644 |
| --- a/content/common/sandbox_mac.mm |
| +++ b/content/common/sandbox_mac.mm |
| @@ -38,6 +38,11 @@ extern "C" { |
| #include "ui/base/layout.h" |
| #include "ui/gl/gl_surface.h" |
| +extern "C" { |
| +void CGSSetDenyWindowServerConnections(bool); |
| +void CGSShutdownServerConnections(); |
| +}; |
| + |
| namespace content { |
| namespace { |
| @@ -268,8 +273,8 @@ void Sandbox::SandboxWarmup(int sandbox_type) { |
| kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host)); |
| // Load in the color profiles we'll need (as a side effect). |
| - (void) base::mac::GetSRGBColorSpace(); |
| - (void) base::mac::GetSystemColorSpace(); |
| + ignore_result(base::mac::GetSRGBColorSpace()); |
| + ignore_result(base::mac::GetSystemColorSpace()); |
| // CGColorSpaceCreateSystemDefaultCMYK - 10.6 |
| base::ScopedCFTypeRef<CGColorSpaceRef> cmyk_colorspace( |
| @@ -325,6 +330,15 @@ void Sandbox::SandboxWarmup(int sandbox_type) { |
| NSColor* color = [NSColor controlTextColor]; |
| [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; |
| } |
| + |
| + if (sandbox_type == SANDBOX_TYPE_RENDERER && |
| + base::mac::IsOSMountainLionOrLater()) { |
| + // Now disconnect from WindowServer, after all objects have been warmed up. |
| + // Shutting down the connection requires connecting to WindowServer, |
| + // so do this before actually engaging the sandbox. |
|
Avi (use Gerrit)
2014/10/21 23:23:17
You may want to comment on why you're only doing t
jeremy
2014/10/22 04:39:37
+1 on Avi's comment.
Robert Sesek
2014/10/23 14:44:23
Done.
|
| + CGSSetDenyWindowServerConnections(true); |
| + CGSShutdownServerConnections(); |
| + } |
| } |
| // static |