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

Side by Side Diff: base/sys_info_chromeos.cc

Issue 19579005: Move ReadFileToString to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « base/process/process_metrics_linux.cc ('k') | base/sys_info_linux.cc » ('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/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 int32* bugfix_version) { 47 int32* bugfix_version) {
48 if (!g_chrome_os_version_numbers.Get().parsed) { 48 if (!g_chrome_os_version_numbers.Get().parsed) {
49 // The other implementations of SysInfo don't block on the disk. 49 // The other implementations of SysInfo don't block on the disk.
50 // See http://code.google.com/p/chromium/issues/detail?id=60394 50 // See http://code.google.com/p/chromium/issues/detail?id=60394
51 // Perhaps the caller ought to cache this? 51 // Perhaps the caller ought to cache this?
52 // Temporary allowing while we work the bug out. 52 // Temporary allowing while we work the bug out.
53 ThreadRestrictions::ScopedAllowIO allow_io; 53 ThreadRestrictions::ScopedAllowIO allow_io;
54 54
55 FilePath path(kLinuxStandardBaseReleaseFile); 55 FilePath path(kLinuxStandardBaseReleaseFile);
56 std::string contents; 56 std::string contents;
57 if (file_util::ReadFileToString(path, &contents)) { 57 if (ReadFileToString(path, &contents)) {
58 g_chrome_os_version_numbers.Get().parsed = true; 58 g_chrome_os_version_numbers.Get().parsed = true;
59 ParseLsbRelease(contents, 59 ParseLsbRelease(contents,
60 &(g_chrome_os_version_numbers.Get().major_version), 60 &(g_chrome_os_version_numbers.Get().major_version),
61 &(g_chrome_os_version_numbers.Get().minor_version), 61 &(g_chrome_os_version_numbers.Get().minor_version),
62 &(g_chrome_os_version_numbers.Get().bugfix_version)); 62 &(g_chrome_os_version_numbers.Get().bugfix_version));
63 } 63 }
64 } 64 }
65 *major_version = g_chrome_os_version_numbers.Get().major_version; 65 *major_version = g_chrome_os_version_numbers.Get().major_version;
66 *minor_version = g_chrome_os_version_numbers.Get().minor_version; 66 *minor_version = g_chrome_os_version_numbers.Get().minor_version;
67 *bugfix_version = g_chrome_os_version_numbers.Get().bugfix_version; 67 *bugfix_version = g_chrome_os_version_numbers.Get().bugfix_version;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 } 111 }
112 } 112 }
113 113
114 // static 114 // static
115 FilePath SysInfo::GetLsbReleaseFilePath() { 115 FilePath SysInfo::GetLsbReleaseFilePath() {
116 return FilePath(kLinuxStandardBaseReleaseFile); 116 return FilePath(kLinuxStandardBaseReleaseFile);
117 } 117 }
118 118
119 } // namespace base 119 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_metrics_linux.cc ('k') | base/sys_info_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698