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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #ifndef NET_BASE_NET_UTIL_H__ 5 #ifndef NET_BASE_NET_UTIL_H__
6 #define NET_BASE_NET_UTIL_H__ 6 #define NET_BASE_NET_UTIL_H__
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #ifdef OS_WIN 10 #ifdef OS_WIN
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 const std::wstring& languages, 151 const std::wstring& languages,
152 std::wstring* out); 152 std::wstring* out);
153 153
154 // Canonicalizes |host| and returns it. Also fills |host_info| with 154 // Canonicalizes |host| and returns it. Also fills |host_info| with
155 // IP address information. |host_info| must not be NULL. 155 // IP address information. |host_info| must not be NULL.
156 std::string CanonicalizeHost(const std::string& host, 156 std::string CanonicalizeHost(const std::string& host,
157 url_canon::CanonHostInfo* host_info); 157 url_canon::CanonHostInfo* host_info);
158 std::string CanonicalizeHost(const std::wstring& host, 158 std::string CanonicalizeHost(const std::wstring& host,
159 url_canon::CanonHostInfo* host_info); 159 url_canon::CanonHostInfo* host_info);
160 160
161 // Returns true if |host| is RFC 1738-compliant (and not an IP address). The
162 // rules are:
163 // * One or more components separated by '.'
164 // * Each component begins and ends with an alphanumeric character
165 // * Each component contains only alphanumeric characters and '-'
166 // * The last component does not begin with a digit
167 //
168 // NOTE: You should only pass in hosts that have been returned from
169 // CanonicalizeHost(), or you may not get accurate results.
170 bool IsCanonicalizedHostRFC1738Compliant(const std::string& host);
171
161 // Call these functions to get the html snippet for a directory listing. 172 // Call these functions to get the html snippet for a directory listing.
162 // The return values of both functions are in UTF-8. 173 // The return values of both functions are in UTF-8.
163 std::string GetDirectoryListingHeader(const string16& title); 174 std::string GetDirectoryListingHeader(const string16& title);
164 175
165 // Given the name of a file in a directory (ftp or local) and 176 // Given the name of a file in a directory (ftp or local) and
166 // other information (is_dir, size, modification time), it returns 177 // other information (is_dir, size, modification time), it returns
167 // the html snippet to add the entry for the file to the directory listing. 178 // the html snippet to add the entry for the file to the directory listing.
168 // Currently, it's a script tag containing a call to a Javascript function 179 // Currently, it's a script tag containing a call to a Javascript function
169 // |addRow|. 180 // |addRow|.
170 // 181 //
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // Strip the portions of |url| that aren't core to the network request. 253 // Strip the portions of |url| that aren't core to the network request.
243 // - user name / password 254 // - user name / password
244 // - reference section 255 // - reference section
245 GURL SimplifyUrlForRequest(const GURL& url); 256 GURL SimplifyUrlForRequest(const GURL& url);
246 257
247 void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports); 258 void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports);
248 259
249 } // namespace net 260 } // namespace net
250 261
251 #endif // NET_BASE_NET_UTIL_H__ 262 #endif // NET_BASE_NET_UTIL_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698