diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 16:26:03 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 16:26:03 +0000 |
commit | 6f33add36219e1faadea9d295b35d43841ebd508 (patch) | |
tree | bc5561b8d3cedeb13e504c971a7992a34e6d2353 /chrome/renderer | |
parent | abf6c7a76bc68d0a01c1665e97972b0056654a26 (diff) | |
download | chromium_src-6f33add36219e1faadea9d295b35d43841ebd508.zip chromium_src-6f33add36219e1faadea9d295b35d43841ebd508.tar.gz chromium_src-6f33add36219e1faadea9d295b35d43841ebd508.tar.bz2 |
Add a macutil for the main app bundle and override
- provide apis to get and override the app bundle
- w/in the core code, use this api for fetching the bundle
- render sandbox config
- resource bundles
- test shell font
- w/in the unittest boot straps, use the mac util to override the bundle so resources can be found.
Review URL: http://codereview.chromium.org/28214
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/renderer_main_platform_delegate_mac.mm | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/chrome/renderer/renderer_main_platform_delegate_mac.mm b/chrome/renderer/renderer_main_platform_delegate_mac.mm index 70ce7f4..2b3a3d5 100644 --- a/chrome/renderer/renderer_main_platform_delegate_mac.mm +++ b/chrome/renderer/renderer_main_platform_delegate_mac.mm @@ -14,6 +14,7 @@ extern "C" { } #include "base/sys_info.h" +#include "base/mac_util.h" #include "chrome/common/chrome_switches.h" #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" @@ -98,27 +99,20 @@ bool RendererMainPlatformDelegate::EnableSandbox() { base::SysInfo::CacheSysInfo(); // For the renderer, we give it a custom sandbox to lock down as tight as - // possible, but still be able to draw. If we're not a renderer process, it - // usually means we're a unittest, so we use a pure compute sandbox instead. - - const char *sandbox_profile = kSBXProfilePureComputation; - uint64_t sandbox_flags = SANDBOX_NAMED; - - if (parameters_.sandbox_info_.ProcessType() == switches::kRendererProcess) { - NSString* sandbox_profile_path = - [[NSBundle mainBundle] pathForResource:@"renderer" ofType:@"sb"]; - BOOL is_dir = NO; - if (![[NSFileManager defaultManager] fileExistsAtPath:sandbox_profile_path - isDirectory:&is_dir] || is_dir) { - LOG(ERROR) << "Failed to find the sandbox profile on disk"; - return false; - } - sandbox_profile = [sandbox_profile_path fileSystemRepresentation]; - sandbox_flags = SANDBOX_NAMED_EXTERNAL; + // possible, but still be able to draw. + + NSString* sandbox_profile_path = + [mac_util::MainAppBundle() pathForResource:@"renderer" ofType:@"sb"]; + BOOL is_dir = NO; + if (![[NSFileManager defaultManager] fileExistsAtPath:sandbox_profile_path + isDirectory:&is_dir] || is_dir) { + LOG(ERROR) << "Failed to find the sandbox profile on disk"; + return false; } + const char *sandbox_profile = [sandbox_profile_path fileSystemRepresentation]; char* error_buff = NULL; - int error = sandbox_init(sandbox_profile, sandbox_flags, + int error = sandbox_init(sandbox_profile, SANDBOX_NAMED_EXTERNAL, &error_buff); bool success = (error == 0 && error_buff == NULL); if (error == -1) { |