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

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

Issue 2177653004: Fix std::string::assign invocation: pass string instead of char*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | 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/files/file_util.h" 7 #include "base/files/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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 data[line_start + 1] == '/') { 158 data[line_start + 1] == '/') {
159 // Skip comments. 159 // Skip comments.
160 line_end = data.find_first_of("\r\n", line_start); 160 line_end = data.find_first_of("\r\n", line_start);
161 if (line_end == std::string::npos) 161 if (line_end == std::string::npos)
162 line_end = data.size(); 162 line_end = data.size();
163 } else { 163 } else {
164 // Truncate at first whitespace. 164 // Truncate at first whitespace.
165 line_end = data.find_first_of("\r\n \t", line_start); 165 line_end = data.find_first_of("\r\n \t", line_start);
166 if (line_end == std::string::npos) 166 if (line_end == std::string::npos)
167 line_end = data.size(); 167 line_end = data.size();
168 domain.assign(data.data(), line_start, line_end - line_start); 168 domain.assign(data, line_start, line_end - line_start);
169 169
170 Rule rule; 170 Rule rule;
171 rule.wildcard = false; 171 rule.wildcard = false;
172 rule.exception = false; 172 rule.exception = false;
173 rule.is_private = is_private; 173 rule.is_private = is_private;
174 NormalizeResult new_result = NormalizeRule(&domain, &rule); 174 NormalizeResult new_result = NormalizeRule(&domain, &rule);
175 if (new_result != kError) { 175 if (new_result != kError) {
176 // Check the existing rules to make sure we don't have an exception and 176 // Check the existing rules to make sure we don't have an exception and
177 // wildcard for the same rule, or that the same domain is listed as both 177 // wildcard for the same rule, or that the same domain is listed as both
178 // private and not private. If we did, we'd have to update our 178 // private and not private. If we did, we'd have to update our
(...skipping 67 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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698