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

Side by Side Diff: base/sys_info_mac.cc

Issue 10704123: Implement SysInfo for iOS (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address review comments Created 8 years, 5 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
« base/sys_info_ios.mm ('K') | « base/sys_info_ios.mm ('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')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 #include <CoreServices/CoreServices.h> 8 #include <CoreServices/CoreServices.h>
9 #include <mach/mach_host.h> 9 #include <mach/mach_host.h>
10 #include <mach/mach_init.h> 10 #include <mach/mach_init.h>
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 // static 41 // static
42 int64 SysInfo::AmountOfPhysicalMemory() { 42 int64 SysInfo::AmountOfPhysicalMemory() {
43 struct host_basic_info hostinfo; 43 struct host_basic_info hostinfo;
44 mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT; 44 mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
45 int result = host_info(mach_host_self(), 45 int result = host_info(mach_host_self(),
46 HOST_BASIC_INFO, 46 HOST_BASIC_INFO,
47 reinterpret_cast<host_info_t>(&hostinfo), 47 reinterpret_cast<host_info_t>(&hostinfo),
48 &count); 48 &count);
49 DCHECK_EQ(HOST_BASIC_INFO_COUNT, count); 49 if (count != HOST_BASIC_INFO_COUNT) {
Mark Mentovai 2012/07/10 16:10:04 Again, I asked you to check result before you chec
Chen Yu 2012/07/10 17:07:30 Done.
50 NOTREACHED();
51 return 0;
52 }
50 if (result != KERN_SUCCESS) { 53 if (result != KERN_SUCCESS) {
51 NOTREACHED(); 54 NOTREACHED();
52 return 0; 55 return 0;
53 } 56 }
54 57
55 return static_cast<int64>(hostinfo.max_mem); 58 return static_cast<int64>(hostinfo.max_mem);
56 } 59 }
57 60
58 } // namespace base 61 } // namespace base
OLDNEW
« base/sys_info_ios.mm ('K') | « base/sys_info_ios.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698