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

Side by Side Diff: net/base/net_util.h

Issue 493253003: Adds default port handling to FormatUrl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | net/base/net_util_icu.cc » ('j') | net/base/net_util_icu.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 NET_EXPORT extern const FormatUrlType kFormatUrlOmitUsernamePassword; 65 NET_EXPORT extern const FormatUrlType kFormatUrlOmitUsernamePassword;
66 66
67 // If the scheme is 'http://', it's removed. 67 // If the scheme is 'http://', it's removed.
68 NET_EXPORT extern const FormatUrlType kFormatUrlOmitHTTP; 68 NET_EXPORT extern const FormatUrlType kFormatUrlOmitHTTP;
69 69
70 // Omits the path if it is just a slash and there is no query or ref. This is 70 // Omits the path if it is just a slash and there is no query or ref. This is
71 // meaningful for non-file "standard" URLs. 71 // meaningful for non-file "standard" URLs.
72 NET_EXPORT extern const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname; 72 NET_EXPORT extern const FormatUrlType kFormatUrlOmitTrailingSlashOnBareHostname;
73 73
74 // Convenience for omitting all unecessary types. 74 // Convenience for omitting all unecessary types.
75 // TODO(dewittj): Determine if "All" should include omitting the default port.
75 NET_EXPORT extern const FormatUrlType kFormatUrlOmitAll; 76 NET_EXPORT extern const FormatUrlType kFormatUrlOmitAll;
76 77
78 // Omits the port if it matches the default for the given scheme.
79 NET_EXPORT extern const FormatUrlType kFormatUrlOmitDefaultPort;
80
77 // Returns the number of explicitly allowed ports; for testing. 81 // Returns the number of explicitly allowed ports; for testing.
78 NET_EXPORT_PRIVATE extern size_t GetCountOfExplicitlyAllowedPorts(); 82 NET_EXPORT_PRIVATE extern size_t GetCountOfExplicitlyAllowedPorts();
79 83
80 // Splits an input of the form <host>[":"<port>] into its consitituent parts. 84 // Splits an input of the form <host>[":"<port>] into its consitituent parts.
81 // Saves the result into |*host| and |*port|. If the input did not have 85 // Saves the result into |*host| and |*port|. If the input did not have
82 // the optional port, sets |*port| to -1. 86 // the optional port, sets |*port| to -1.
83 // Returns true if the parsing was successful, false otherwise. 87 // Returns true if the parsing was successful, false otherwise.
84 // The returned host is NOT canonicalized, and may be invalid. If <host> is 88 // The returned host is NOT canonicalized, and may be invalid. If <host> is
85 // an IPv6 literal address, the returned host includes the square brackets. 89 // an IPv6 literal address, the returned host includes the square brackets.
86 NET_EXPORT bool ParseHostAndPort( 90 NET_EXPORT bool ParseHostAndPort(
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 DSCP_CS5 = 40, // Video 535 DSCP_CS5 = 40, // Video
532 DSCP_EF = 46, // Voice 536 DSCP_EF = 46, // Voice
533 DSCP_CS6 = 48, // Voice 537 DSCP_CS6 = 48, // Voice
534 DSCP_CS7 = 56, // Control messages 538 DSCP_CS7 = 56, // Control messages
535 DSCP_LAST = DSCP_CS7 539 DSCP_LAST = DSCP_CS7
536 }; 540 };
537 541
538 } // namespace net 542 } // namespace net
539 543
540 #endif // NET_BASE_NET_UTIL_H_ 544 #endif // NET_BASE_NET_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/net_util_icu.cc » ('j') | net/base/net_util_icu.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698