Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9103)

Unified Diff: chrome/renderer/renderer_main_platform_delegate_mac.mm

Issue 28214: Add a macutil for the main app bundle and override... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/renderer_main_platform_delegate_mac.mm
===================================================================
--- chrome/renderer/renderer_main_platform_delegate_mac.mm (revision 10790)
+++ chrome/renderer/renderer_main_platform_delegate_mac.mm (working copy)
@@ -14,6 +14,7 @@
}
#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 @@
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.
+ // possible, but still be able to draw.
- 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;
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698