summaryrefslogtreecommitdiffstats
path: root/net/base/net_util.h
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 08:11:42 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 08:11:42 +0000
commitf6fb2de77993bbd88931ba205b0cc1e3423111f6 (patch)
tree831dbc093048f60b7d3cfa6548d42cedc340b4d7 /net/base/net_util.h
parent77c846f5d8043e56543668971fff356d58380cf7 (diff)
downloadchromium_src-f6fb2de77993bbd88931ba205b0cc1e3423111f6.zip
chromium_src-f6fb2de77993bbd88931ba205b0cc1e3423111f6.tar.gz
chromium_src-f6fb2de77993bbd88931ba205b0cc1e3423111f6.tar.bz2
Add parsing for PAC result strings -- ProxyInfo::UsePacString().
Added the support class ProxyServer to avoid losing the proxy server's type information (http, socks) when populating the list. The format of the configuration strings has been extended accordingly to include an optional [<scheme>"://"] prefix. (i.e. "http://", "socks4://", "socks5://"). Review URL: http://codereview.chromium.org/20398 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/net_util.h')
-rw-r--r--net/base/net_util.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/base/net_util.h b/net/base/net_util.h
index ddaa77b..e62e95a 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -40,6 +40,19 @@ bool FileURLToFilePath(const GURL& url, FilePath* file_path);
// Deprecated temporary compatibility function.
bool FileURLToFilePath(const GURL& url, std::wstring* file_path);
+// Split an input of the form <host>[":"<port>] into its consitituent parts.
+// Saves the result into |*host| and |*port|. If the input did not have
+// the optional port, sets |*port| to -1.
+// Returns true if the parsing was successful, false otherwise.
+// TODO(eroman): support IPv6 literals.
+bool GetHostAndPort(std::string::const_iterator host_and_port_begin,
+ std::string::const_iterator host_and_port_end,
+ std::string* host,
+ int* port);
+bool GetHostAndPort(const std::string& host_and_port,
+ std::string* host,
+ int* port);
+
// Return the value of the HTTP response header with name 'name'. 'headers'
// should be in the format that URLRequest::GetResponseHeaders() returns.
// Returns the empty string if the header is not found.