Index: content/common/sandbox_mac.mm |
diff --git a/content/common/sandbox_mac.mm b/content/common/sandbox_mac.mm |
index 90b7fe921a0f6a62d4c19a15ce29cb6e80447cbe..42fac8c3721db01e31c34814749ab0134da7dbf6 100644 |
--- a/content/common/sandbox_mac.mm |
+++ b/content/common/sandbox_mac.mm |
@@ -271,9 +271,9 @@ void Sandbox::SandboxWarmup(int sandbox_type) { |
// Process-type dependent warm-up. |
if (sandbox_type == content::SANDBOX_TYPE_GPU) { |
- // Preload either the desktop GL or the osmesa so, depending on the |
- // --use-gl flag. |
- gfx::GLSurface::InitializeOneOff(); |
+ // Preload either the desktop GL or the osmesa so, depending on the |
+ // --use-gl flag. |
+ gfx::GLSurface::InitializeOneOff(); |
} |
} |
@@ -380,10 +380,20 @@ NSString* LoadSandboxTemplate(int sandbox_type) { |
return nil; |
} |
- scoped_nsobject<NSString> common_sandbox_prefix_data( |
- [[NSString alloc] initWithBytes:common_sandbox_definition.data() |
- length:common_sandbox_definition.length() |
- encoding:NSUTF8StringEncoding]); |
+ NSString* common_sandbox_prefix_data = |
Mark Mentovai
2012/05/30 13:38:22
I’m leery of taking this out of the scoped_nsobjec
Nico
2012/05/30 15:03:29
Done.
|
+ [[[NSString alloc] initWithBytes:common_sandbox_definition.data() |
+ length:common_sandbox_definition.length() |
+ encoding:NSUTF8StringEncoding] autorelease]; |
+ |
+#if defined(COMPONENT_BUILD) |
+ // dlopen() fails without file-read-metadata access if the executable image |
+ // contains LC_RPATH load commands. The components build uses those. |
+ // See http://crbug.com/127465 |
+ if (base::mac::IsOSSnowLeopardOrEarlier()) { |
+ common_sandbox_prefix_data = [common_sandbox_prefix_data |
+ stringByAppendingString:@"\n(allow file-read-metadata)\n"]; |
+ } |
+#endif |
scoped_nsobject<NSString> sandbox_data( |
[[NSString alloc] initWithBytes:sandbox_definition.data() |