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

Side by Side Diff: chrome/renderer/renderer_main_platform_delegate_mac.mm

Issue 180025: Merge 24777 - Fix crashonlaunch on Snow Leopard... (Closed) Base URL: svn://chrome-svn/chrome/branches/203/src/
Patch Set: Created 11 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/renderer.sb ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/chrome/renderer/renderer_main_platform_delegate_mac.mm:r69-2775
Merged /trunk/src/chrome/renderer/renderer_main_platform_delegate_mac.mm:r24777
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/renderer_main_platform_delegate.h" 5 #include "chrome/renderer/renderer_main_platform_delegate.h"
6 6
7 #include "base/debug_util.h" 7 #include "base/debug_util.h"
8 8
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
10 #import <ApplicationServices/ApplicationServices.h> 10 #import <ApplicationServices/ApplicationServices.h>
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 LOG(ERROR) << "Failed to find the sandbox profile on disk"; 124 LOG(ERROR) << "Failed to find the sandbox profile on disk";
125 return false; 125 return false;
126 } 126 }
127 127
128 // Splice the path of the user's home directory into the sandbox profile 128 // Splice the path of the user's home directory into the sandbox profile
129 // (see renderer.sb for details). 129 // (see renderer.sb for details).
130 sandbox_data = [sandbox_data 130 sandbox_data = [sandbox_data
131 stringByReplacingOccurrencesOfString:@"USER_HOMEDIR" 131 stringByReplacingOccurrencesOfString:@"USER_HOMEDIR"
132 withString:NSHomeDirectory()]; 132 withString:NSHomeDirectory()];
133 133
134 // Enable 10.5 only sandbox syntax.
135 int32 major_version = 0;
136 int32 minor_version = 0;
137 int32 bugfix_version = 0;
138 base::SysInfo::OperatingSystemVersionNumbers(&major_version,
139 &minor_version,
140 &bugfix_version);
141
142 if (major_version == 10 && minor_version == 5) {
143 sandbox_data = [sandbox_data
144 stringByReplacingOccurrencesOfString:@";10.5_ONLY"
145 withString:@""];
146 }
147
134 char* error_buff = NULL; 148 char* error_buff = NULL;
135 int error = sandbox_init([sandbox_data UTF8String], 0, &error_buff); 149 int error = sandbox_init([sandbox_data UTF8String], 0, &error_buff);
136 bool success = (error == 0 && error_buff == NULL); 150 bool success = (error == 0 && error_buff == NULL);
137 if (error == -1) { 151 if (error == -1) {
138 LOG(ERROR) << "Failed to Initialize Sandbox: " << error_buff; 152 LOG(ERROR) << "Failed to Initialize Sandbox: " << error_buff;
139 } 153 }
140 sandbox_free_error(error_buff); 154 sandbox_free_error(error_buff);
141 return success; 155 return success;
142 } 156 }
143 157
144 void RendererMainPlatformDelegate::RunSandboxTests() { 158 void RendererMainPlatformDelegate::RunSandboxTests() {
145 // TODO(port): Run sandbox unit test here. 159 // TODO(port): Run sandbox unit test here.
146 } 160 }
OLDNEW
« no previous file with comments | « chrome/renderer/renderer.sb ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698