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

Side by Side Diff: base/sys_info_mac.cc

Issue 174254: Some tweaks to the OS X Sandbox: (Closed)
Patch Set: Created 11 years, 4 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
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 "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include <CoreServices/CoreServices.h> 7 #include <CoreServices/CoreServices.h>
8 8
9 namespace base { 9 namespace base {
10 10
11 // static 11 // static
12 void SysInfo::OperatingSystemVersionNumbers(int32 *major_version, 12 void SysInfo::OperatingSystemVersionNumbers(int32 *major_version,
13 int32 *minor_version, 13 int32 *minor_version,
14 int32 *bugfix_version) { 14 int32 *bugfix_version) {
15 int32 major_version_cached = 0;
16 int32 minor_version_cached = 0;
17 int32 bugfix_version_cached = 0;
18
19 // Gestalt can't be called in the sandbox, so we cache its return value.
20 Gestalt(gestaltSystemVersionMajor, 15 Gestalt(gestaltSystemVersionMajor,
21 reinterpret_cast<SInt32*>(&major_version_cached)); 16 reinterpret_cast<SInt32*>(major_version));
22 Gestalt(gestaltSystemVersionMinor, 17 Gestalt(gestaltSystemVersionMinor,
23 reinterpret_cast<SInt32*>(&minor_version_cached)); 18 reinterpret_cast<SInt32*>(minor_version));
24 Gestalt(gestaltSystemVersionBugFix, 19 Gestalt(gestaltSystemVersionBugFix,
25 reinterpret_cast<SInt32*>(&bugfix_version_cached)); 20 reinterpret_cast<SInt32*>(bugfix_version));
26
27 *major_version = major_version_cached;
28 *minor_version = minor_version_cached;
29 *bugfix_version = bugfix_version_cached;
30 } 21 }
31 22
32 } // namespace base 23 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/renderer.sb » ('j') | chrome/renderer/renderer_main_platform_delegate_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698