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

Side by Side Diff: net/base/host_port_pair.cc

Issue 1755005: SPDY: Fix Alternate-Protocol. (Closed)
Patch Set: Address mbelshe's comments. Created 10 years, 8 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 | « net/base/host_port_pair.h ('k') | net/http/http_network_transaction.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "net/base/host_port_pair.h" 5 #include "net/base/host_port_pair.h"
6 #include "base/string_util.h" 6 #include "base/string_util.h"
7 7
8 namespace net { 8 namespace net {
9 9
10 HostPortPair::HostPortPair() : port(0) {}
11 HostPortPair::HostPortPair(const std::string& in_host, uint16 in_port)
12 : host(in_host), port(in_port) {}
13
10 std::string HostPortPair::ToString() const { 14 std::string HostPortPair::ToString() const {
11 return StringPrintf("[Host: %s, Port: %u]", host.c_str(), port); 15 // Check to see if the host is an IPv6 address. If so, added brackets.
16 if (host.find(':') != std::string::npos)
17 return StringPrintf("[%s]:%u", host.c_str(), port);
18 return StringPrintf("%s:%u", host.c_str(), port);
12 } 19 }
13 20
14 } // namespace net 21 } // namespace net
OLDNEW
« no previous file with comments | « net/base/host_port_pair.h ('k') | net/http/http_network_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698