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

Unified Diff: net/base/net_util.h

Issue 271116: Classify more types of input as queries.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: net/base/net_util.h
===================================================================
--- net/base/net_util.h (revision 29226)
+++ net/base/net_util.h (working copy)
@@ -158,6 +158,17 @@
std::string CanonicalizeHost(const std::wstring& host,
url_canon::CanonHostInfo* host_info);
+// Returns true if |host| is RFC 1738-compliant (and not an IP address). The
+// rules are:
+// * One or more components separated by '.'
+// * Each component begins and ends with an alphanumeric character
+// * Each component contains only alphanumeric characters and '-'
+// * The last component does not begin with a digit
+//
+// NOTE: You should only pass in hosts that have been returned from
+// CanonicalizeHost(), or you may not get accurate results.
+bool IsCanonicalizedHostRFC1738Compliant(const std::string& host);
+
// Call these functions to get the html snippet for a directory listing.
// The return values of both functions are in UTF-8.
std::string GetDirectoryListingHeader(const string16& title);

Powered by Google App Engine
This is Rietveld 408576698