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

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

Issue 255333003: Renamed namespaces in src/net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue 04/29/2014 19:22:06.75 Created 6 years, 7 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/socket_stream/socket_stream_job.cc ('k') | net/url_request/url_request.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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 domain->find('!', start_offset) != std::string::npos) { 108 domain->find('!', start_offset) != std::string::npos) {
109 LOG(WARNING) << "Keeping probably invalid rule: " << *domain; 109 LOG(WARNING) << "Keeping probably invalid rule: " << *domain;
110 result = kWarning; 110 result = kWarning;
111 } 111 }
112 112
113 // Make a GURL and normalize it, then get the host back out. 113 // Make a GURL and normalize it, then get the host back out.
114 std::string url = "http://"; 114 std::string url = "http://";
115 url.append(*domain); 115 url.append(*domain);
116 GURL gurl(url); 116 GURL gurl(url);
117 const std::string& spec = gurl.possibly_invalid_spec(); 117 const std::string& spec = gurl.possibly_invalid_spec();
118 url_parse::Component host = gurl.parsed_for_possibly_invalid_spec().host; 118 url::Component host = gurl.parsed_for_possibly_invalid_spec().host;
119 if (host.len < 0) { 119 if (host.len < 0) {
120 LOG(ERROR) << "Ignoring rule that couldn't be normalized: " << *domain; 120 LOG(ERROR) << "Ignoring rule that couldn't be normalized: " << *domain;
121 return kError; 121 return kError;
122 } 122 }
123 if (!gurl.is_valid()) { 123 if (!gurl.is_valid()) {
124 LOG(WARNING) << "Keeping rule that GURL says is invalid: " << *domain; 124 LOG(WARNING) << "Keeping rule that GURL says is invalid: " << *domain;
125 result = kWarning; 125 result = kWarning;
126 } 126 }
127 domain->assign(spec.substr(host.begin, host.len)); 127 domain->assign(spec.substr(host.begin, host.len));
128 128
(...skipping 117 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/socket_stream/socket_stream_job.cc ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698