From 564b491ea6d163724307331648bd7b45cdada99e Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Tue, 9 Mar 2010 16:30:42 +0000 Subject: SPDY: Add basic support for Alternate-Protocol header. Review URL: http://codereview.chromium.org/668197 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41032 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/host_port_pair.cc | 14 ++++++++++++++ net/base/host_port_pair.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 net/base/host_port_pair.cc create mode 100644 net/base/host_port_pair.h (limited to 'net/base') diff --git a/net/base/host_port_pair.cc b/net/base/host_port_pair.cc new file mode 100644 index 0000000..06a95fb --- /dev/null +++ b/net/base/host_port_pair.cc @@ -0,0 +1,14 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/base/host_port_pair.h" +#include "base/string_util.h" + +namespace net { + +std::string HostPortPair::ToString() const { + return StringPrintf("[Host: %s, Port: %u]", host.c_str(), port); +} + +} // namespace net diff --git a/net/base/host_port_pair.h b/net/base/host_port_pair.h new file mode 100644 index 0000000..ab7f312 --- /dev/null +++ b/net/base/host_port_pair.h @@ -0,0 +1,33 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_BASE_HOST_PORT_PAIR_H_ +#define NET_BASE_HOST_PORT_PAIR_H_ + +#include +#include "base/basictypes.h" + +namespace net { + +struct HostPortPair { + HostPortPair() {} + HostPortPair(const std::string& in_host, uint16 in_port) + : host(in_host), port(in_port) {} + + // Comparator function so this can be placed in a std::map. + bool operator<(const HostPortPair& other) const { + if (host != other.host) + return host < other.host; + return port < other.port; + } + + std::string ToString() const; + + std::string host; + uint16 port; +}; + +} // namespace net + +#endif // NET_BASE_HOST_PORT_PAIR_H_ -- cgit v1.1