OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ios/device_util.h" | 5 #include "base/ios/device_util.h" |
6 | 6 |
7 #include <CommonCrypto/CommonDigest.h> | 7 #include <CommonCrypto/CommonDigest.h> |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include <ifaddrs.h> | 10 #include <ifaddrs.h> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 namespace ios { | 55 namespace ios { |
56 namespace device_util { | 56 namespace device_util { |
57 | 57 |
58 std::string GetPlatform() { | 58 std::string GetPlatform() { |
59 std::string platform; | 59 std::string platform; |
60 size_t size = 0; | 60 size_t size = 0; |
61 sysctlbyname("hw.machine", NULL, &size, NULL, 0); | 61 sysctlbyname("hw.machine", NULL, &size, NULL, 0); |
62 sysctlbyname("hw.machine", WriteInto(&platform, size), &size, NULL, 0); | 62 sysctlbyname("hw.machine", base::WriteInto(&platform, size), &size, NULL, 0); |
63 return platform; | 63 return platform; |
64 } | 64 } |
65 | 65 |
66 bool RamIsAtLeast512Mb() { | 66 bool RamIsAtLeast512Mb() { |
67 // 512MB devices report anywhere from 502-504 MB, use 450 MB just to be safe. | 67 // 512MB devices report anywhere from 502-504 MB, use 450 MB just to be safe. |
68 return RamIsAtLeast(450); | 68 return RamIsAtLeast(450); |
69 } | 69 } |
70 | 70 |
71 bool RamIsAtLeast1024Mb() { | 71 bool RamIsAtLeast1024Mb() { |
72 // 1GB devices report anywhere from 975-999 MB, use 900 MB just to be safe. | 72 // 1GB devices report anywhere from 975-999 MB, use 900 MB just to be safe. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 base::ScopedCFTypeRef<CFUUIDRef> uuid_object( | 169 base::ScopedCFTypeRef<CFUUIDRef> uuid_object( |
170 CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault, *uuid_bytes)); | 170 CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault, *uuid_bytes)); |
171 base::ScopedCFTypeRef<CFStringRef> device_id( | 171 base::ScopedCFTypeRef<CFStringRef> device_id( |
172 CFUUIDCreateString(kCFAllocatorDefault, uuid_object)); | 172 CFUUIDCreateString(kCFAllocatorDefault, uuid_object)); |
173 return base::SysCFStringRefToUTF8(device_id); | 173 return base::SysCFStringRefToUTF8(device_id); |
174 } | 174 } |
175 | 175 |
176 } // namespace device_util | 176 } // namespace device_util |
177 } // namespace ios | 177 } // namespace ios |
OLD | NEW |