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

Side by Side Diff: net/tools/tld_cleanup/tld_cleanup_util.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 | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/url_request/url_fetcher_impl_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/tools/tld_cleanup/tld_cleanup_util.h" 5 #include "net/tools/tld_cleanup/tld_cleanup_util.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 226 }
227 } 227 }
228 228
229 return result; 229 return result;
230 } 230 }
231 231
232 NormalizeResult NormalizeFile(const base::FilePath& in_filename, 232 NormalizeResult NormalizeFile(const base::FilePath& in_filename,
233 const base::FilePath& out_filename) { 233 const base::FilePath& out_filename) {
234 RuleMap rules; 234 RuleMap rules;
235 std::string data; 235 std::string data;
236 if (!file_util::ReadFileToString(in_filename, &data)) { 236 if (!base::ReadFileToString(in_filename, &data)) {
237 LOG(ERROR) << "Unable to read file"; 237 LOG(ERROR) << "Unable to read file";
238 // We return success since we've already reported the error. 238 // We return success since we've already reported the error.
239 return kSuccess; 239 return kSuccess;
240 } 240 }
241 241
242 NormalizeResult result = NormalizeDataToRuleMap(data, &rules); 242 NormalizeResult result = NormalizeDataToRuleMap(data, &rules);
243 243
244 if (!WriteRules(rules, out_filename)) { 244 if (!WriteRules(rules, out_filename)) {
245 LOG(ERROR) << "Error(s) writing output file"; 245 LOG(ERROR) << "Error(s) writing output file";
246 result = kError; 246 result = kError;
247 } 247 }
248 248
249 return result; 249 return result;
250 } 250 }
251 251
252 252
253 } // namespace tld_cleanup 253 } // namespace tld_cleanup
254 } // namespace net 254 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/url_request/url_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698