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

Side by Side Diff: net/tools/tld_cleanup/tld_cleanup_util.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/crl_set_dump/crl_set_dump.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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 if (i->second.is_private) { 55 if (i->second.is_private) {
56 type += kPrivateRule; 56 type += kPrivateRule;
57 } 57 }
58 data.append(base::IntToString(type)); 58 data.append(base::IntToString(type));
59 data.append("\n"); 59 data.append("\n");
60 } 60 }
61 61
62 data.append("%%\n"); 62 data.append("%%\n");
63 63
64 int written = file_util::WriteFile(outfile, 64 int written = base::WriteFile(outfile,
65 data.data(), 65 data.data(),
66 static_cast<int>(data.size())); 66 static_cast<int>(data.size()));
67 67
68 return written == static_cast<int>(data.size()); 68 return written == static_cast<int>(data.size());
69 } 69 }
70 70
71 // Adjusts the rule to a standard form: removes single extraneous dots and 71 // Adjusts the rule to a standard form: removes single extraneous dots and
72 // canonicalizes it using GURL. Returns kSuccess if the rule is interpreted as 72 // canonicalizes it using GURL. Returns kSuccess if the rule is interpreted as
73 // valid; logs a warning and returns kWarning if it is probably invalid; and 73 // valid; logs a warning and returns kWarning if it is probably invalid; and
74 // logs an error and returns kError if the rule is (almost) certainly invalid. 74 // logs an error and returns kError if the rule is (almost) certainly invalid.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 LOG(ERROR) << "Error(s) writing output file"; 246 LOG(ERROR) << "Error(s) writing output file";
247 result = kError; 247 result = kError;
248 } 248 }
249 249
250 return result; 250 return result;
251 } 251 }
252 252
253 253
254 } // namespace tld_cleanup 254 } // namespace tld_cleanup
255 } // namespace net 255 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/crl_set_dump/crl_set_dump.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