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

Side by Side Diff: chrome/browser/chromeos/system_logs/lsb_release_log_source.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
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 "chrome/browser/chromeos/system_logs/lsb_release_log_source.h" 5 #include "chrome/browser/chromeos/system_logs/lsb_release_log_source.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 26 matching lines...) Expand all
37 base::Bind(&LsbReleaseLogSource::ReadLSBRelease, response), 37 base::Bind(&LsbReleaseLogSource::ReadLSBRelease, response),
38 base::Bind(callback, 38 base::Bind(callback,
39 base::Owned(response))); 39 base::Owned(response)));
40 } 40 }
41 41
42 void LsbReleaseLogSource::ReadLSBRelease(SystemLogsResponse* response) { 42 void LsbReleaseLogSource::ReadLSBRelease(SystemLogsResponse* response) {
43 DCHECK(response); 43 DCHECK(response);
44 44
45 const base::FilePath lsb_release_file("/etc/lsb-release"); 45 const base::FilePath lsb_release_file("/etc/lsb-release");
46 std::string lsb_data; 46 std::string lsb_data;
47 bool read_success = file_util::ReadFileToString(lsb_release_file, &lsb_data); 47 bool read_success = base::ReadFileToString(lsb_release_file, &lsb_data);
48 // if we were using an internal temp file, the user does not need the 48 // if we were using an internal temp file, the user does not need the
49 // logs to stay past the ReadFile call - delete the file 49 // logs to stay past the ReadFile call - delete the file
50 if (!read_success) { 50 if (!read_success) {
51 LOG(ERROR) << "Can't access /etc/lsb-release file."; 51 LOG(ERROR) << "Can't access /etc/lsb-release file.";
52 return; 52 return;
53 } 53 }
54 ParseLSBRelease(lsb_data, response); 54 ParseLSBRelease(lsb_data, response);
55 } 55 }
56 56
57 void LsbReleaseLogSource::ParseLSBRelease(const std::string& lsb_data, 57 void LsbReleaseLogSource::ParseLSBRelease(const std::string& lsb_data,
(...skipping 15 matching lines...) Expand all
73 73
74 if (value.empty()) 74 if (value.empty())
75 (*response)[key] = kEmptyLogEntry; 75 (*response)[key] = kEmptyLogEntry;
76 else 76 else
77 (*response)[key] = value; 77 (*response)[key] = value;
78 } 78 }
79 } 79 }
80 80
81 } // namespace chromeos 81 } // namespace chromeos
82 82
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/system_logs/debug_daemon_log_source.cc ('k') | chrome/browser/chromeos/version_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698