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

Unified Diff: net/base/dns_util.cc

Issue 8835011: Revert 113282 - Isolates generic DnsClient from AsyncHostResolver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/dns_util.h ('k') | net/dns/async_host_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/dns_util.cc
===================================================================
--- net/base/dns_util.cc (revision 113383)
+++ net/base/dns_util.cc (working copy)
@@ -9,7 +9,7 @@
namespace net {
// Based on DJB's public domain code.
-bool DNSDomainFromDot(const base::StringPiece& dotted, std::string* out) {
+bool DNSDomainFromDot(const std::string& dotted, std::string* out) {
const char* buf = dotted.data();
unsigned n = dotted.size();
char label[63];
@@ -56,7 +56,7 @@
return true;
}
-std::string DNSDomainToString(const base::StringPiece& domain) {
+std::string DNSDomainToString(const std::string& domain) {
std::string ret;
for (unsigned i = 0; i < domain.size() && domain[i]; i += domain[i] + 1) {
@@ -73,7 +73,7 @@
if (static_cast<unsigned>(domain[i]) + i + 1 > domain.size())
return "";
- domain.substr(i + 1, domain[i]).AppendToString(&ret);
+ ret += domain.substr(i + 1, domain[i]);
}
return ret;
}
@@ -92,13 +92,12 @@
return true;
}
-std::string TrimEndingDot(const base::StringPiece& host) {
- base::StringPiece host_trimmed = host;
+std::string TrimEndingDot(const std::string& host) {
+ std::string host_trimmed = host;
size_t len = host_trimmed.length();
- if (len > 1 && host_trimmed[len - 1] == '.') {
- host_trimmed.remove_suffix(1);
- }
- return host_trimmed.as_string();
+ if (len > 1 && host_trimmed[len - 1] == '.')
+ host_trimmed.erase(len - 1);
+ return host_trimmed;
}
bool DnsResponseBuffer::U8(uint8* v) {
« no previous file with comments | « net/base/dns_util.h ('k') | net/dns/async_host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698