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

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

Issue 602973002: Change ParseHostAndPort() to not include brackets around IPv6 literals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment Created 6 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
« no previous file with comments | « no previous file | net/base/net_util.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 (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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // Convenience for omitting all unecessary types. 74 // Convenience for omitting all unecessary types.
75 NET_EXPORT extern const FormatUrlType kFormatUrlOmitAll; 75 NET_EXPORT extern const FormatUrlType kFormatUrlOmitAll;
76 76
77 // Returns the number of explicitly allowed ports; for testing. 77 // Returns the number of explicitly allowed ports; for testing.
78 NET_EXPORT_PRIVATE extern size_t GetCountOfExplicitlyAllowedPorts(); 78 NET_EXPORT_PRIVATE extern size_t GetCountOfExplicitlyAllowedPorts();
79 79
80 // Splits an input of the form <host>[":"<port>] into its consitituent parts. 80 // 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 81 // Saves the result into |*host| and |*port|. If the input did not have
82 // the optional port, sets |*port| to -1. 82 // the optional port, sets |*port| to -1.
83 // Returns true if the parsing was successful, false otherwise. 83 // Returns true if the parsing was successful, false otherwise.
84 // The returned host is NOT canonicalized, and may be invalid. If <host> is 84 // The returned host is NOT canonicalized, and may be invalid.
85 // an IPv6 literal address, the returned host includes the square brackets. 85 //
86 // IPv6 literals must be specified in a bracketed form, for instance:
87 // [::1]:90 and [::1]
88 //
89 // The resultant |*host| in both cases will be "::1" (not bracketed).
86 NET_EXPORT bool ParseHostAndPort( 90 NET_EXPORT bool ParseHostAndPort(
87 std::string::const_iterator host_and_port_begin, 91 std::string::const_iterator host_and_port_begin,
88 std::string::const_iterator host_and_port_end, 92 std::string::const_iterator host_and_port_end,
89 std::string* host, 93 std::string* host,
90 int* port); 94 int* port);
91 NET_EXPORT bool ParseHostAndPort( 95 NET_EXPORT bool ParseHostAndPort(
92 const std::string& host_and_port, 96 const std::string& host_and_port,
93 std::string* host, 97 std::string* host,
94 int* port); 98 int* port);
95 99
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 DSCP_CS5 = 40, // Video 577 DSCP_CS5 = 40, // Video
574 DSCP_EF = 46, // Voice 578 DSCP_EF = 46, // Voice
575 DSCP_CS6 = 48, // Voice 579 DSCP_CS6 = 48, // Voice
576 DSCP_CS7 = 56, // Control messages 580 DSCP_CS7 = 56, // Control messages
577 DSCP_LAST = DSCP_CS7 581 DSCP_LAST = DSCP_CS7
578 }; 582 };
579 583
580 } // namespace net 584 } // namespace net
581 585
582 #endif // NET_BASE_NET_UTIL_H_ 586 #endif // NET_BASE_NET_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698