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

Side by Side Diff: base/ios/device_util.mm

Issue 1223983002: Move WriteInto to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « base/base_paths_mac.mm ('k') | base/strings/string_util.h » ('j') | 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) 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
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
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
OLDNEW
« no previous file with comments | « base/base_paths_mac.mm ('k') | base/strings/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698