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

Unified Diff: content/common/sandbox_mac.mm

Issue 7144007: Improve and unify Mac OS X run-time version checks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « content/browser/renderer_host/backing_store_mac.mm ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/sandbox_mac.mm
===================================================================
--- content/common/sandbox_mac.mm (revision 88826)
+++ content/common/sandbox_mac.mm (working copy)
@@ -384,18 +384,6 @@
return [common_sandbox_prefix_data stringByAppendingString:sandbox_data];
}
-// Retrieve OS X version, output parameters are self explanatory.
-void GetOSVersion(bool* snow_leopard_or_higher, bool* lion_or_higher) {
- int32 major_version, minor_version, bugfix_version;
- base::SysInfo::OperatingSystemVersionNumbers(&major_version,
- &minor_version,
- &bugfix_version);
- *snow_leopard_or_higher =
- (major_version > 10 || (major_version == 10 && minor_version >= 6));
- *lion_or_higher =
- (major_version > 10 || (major_version == 10 && minor_version >= 7));
-}
-
// static
bool Sandbox::PostProcessSandboxProfile(
NSString* sandbox_template,
@@ -506,14 +494,13 @@
[tokens_to_remove addObject:@";ENABLE_LOGGING"];
}
- bool snow_leopard_or_higher;
- bool lion_or_higher;
- GetOSVersion(&snow_leopard_or_higher, &lion_or_higher);
+ bool snow_leopard_or_later = base::mac::IsOSSnowLeopardOrLater();
+ bool lion_or_later = base::mac::IsOSLionOrLater();
// Without this, the sandbox will print a message to the system log every
// time it denies a request. This floods the console with useless spew. The
// (with no-log) syntax is only supported on 10.6+
- if (snow_leopard_or_higher && !enable_logging) {
+ if (snow_leopard_or_later && !enable_logging) {
substitutions["DISABLE_SANDBOX_DENIAL_LOGGING"] =
SandboxSubstring("(with no-log)");
} else {
@@ -531,12 +518,12 @@
SandboxSubstring(home_dir_canonical.value(),
SandboxSubstring::LITERAL);
- if (lion_or_higher) {
+ if (lion_or_later) {
// >=10.7 Sandbox rules.
[tokens_to_remove addObject:@";10.7_OR_ABOVE"];
}
- if (snow_leopard_or_higher) {
+ if (snow_leopard_or_later) {
// >=10.6 Sandbox rules.
[tokens_to_remove addObject:@";10.6_OR_ABOVE"];
} else {
« no previous file with comments | « content/browser/renderer_host/backing_store_mac.mm ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698