summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
authorpliard@chromium.org <pliard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-23 18:23:26 +0000
committerpliard@chromium.org <pliard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-23 18:23:26 +0000
commit83088b2c3cf332a53d866c92b8106c26fb2395a3 (patch)
treebd025d079b6c380dfb8731abe7fe3b19b6b0f16f /net/tools
parent2cd6eac027ab13ee08800130d5738ca4950d5079 (diff)
downloadchromium_src-83088b2c3cf332a53d866c92b8106c26fb2395a3.zip
chromium_src-83088b2c3cf332a53d866c92b8106c26fb2395a3.tar.gz
chromium_src-83088b2c3cf332a53d866c92b8106c26fb2395a3.tar.bz2
Upstream changes making ListenSocket an abstract class.
This is part of Chrome for Android upstreaming. This CL makes ListenSocket an abstract class instead of a concrete class implementing a TCP Listen Socket. This abstraction will be used later to make HttpServer seamlessly operate on TCP sockets and Unix domain sockets (will be upstreamed in a separate CL). The TCP Listen socket implementation, previously in listen_socket.{cc,h}, is now in tcp_listen_socket.{cc,h}. TEST=net_unittests Review URL: http://codereview.chromium.org/10108015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r--net/tools/fetch/http_listen_socket.cc16
-rw-r--r--net/tools/fetch/http_listen_socket.h6
2 files changed, 11 insertions, 11 deletions
diff --git a/net/tools/fetch/http_listen_socket.cc b/net/tools/fetch/http_listen_socket.cc
index fc9f5f3..60c6f94 100644
--- a/net/tools/fetch/http_listen_socket.cc
+++ b/net/tools/fetch/http_listen_socket.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -16,7 +16,7 @@
// must run in the IO thread
HttpListenSocket::HttpListenSocket(SOCKET s,
HttpListenSocket::Delegate* delegate)
- : ALLOW_THIS_IN_INITIALIZER_LIST(net::ListenSocket(s, this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(net::TCPListenSocket(s, this)),
delegate_(delegate) {
}
@@ -25,13 +25,13 @@ HttpListenSocket::~HttpListenSocket() {
}
void HttpListenSocket::Listen() {
- net::ListenSocket::Listen();
+ net::TCPListenSocket::Listen();
}
void HttpListenSocket::Accept() {
- SOCKET conn = net::ListenSocket::Accept(socket_);
- DCHECK_NE(conn, net::ListenSocket::kInvalidSocket);
- if (conn == net::ListenSocket::kInvalidSocket) {
+ SOCKET conn = net::TCPListenSocket::Accept(socket_);
+ DCHECK_NE(conn, net::TCPListenSocket::kInvalidSocket);
+ if (conn == net::TCPListenSocket::kInvalidSocket) {
// TODO
} else {
scoped_refptr<HttpListenSocket> sock(
@@ -45,8 +45,8 @@ HttpListenSocket* HttpListenSocket::Listen(
const std::string& ip,
int port,
HttpListenSocket::Delegate* delegate) {
- SOCKET s = net::ListenSocket::Listen(ip, port);
- if (s == net::ListenSocket::kInvalidSocket) {
+ SOCKET s = net::TCPListenSocket::CreateAndBind(ip, port);
+ if (s == net::TCPListenSocket::kInvalidSocket) {
// TODO (ibrar): error handling
} else {
HttpListenSocket *serv = new HttpListenSocket(s, delegate);
diff --git a/net/tools/fetch/http_listen_socket.h b/net/tools/fetch/http_listen_socket.h
index 18e3a46..8a09a9e 100644
--- a/net/tools/fetch/http_listen_socket.h
+++ b/net/tools/fetch/http_listen_socket.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -7,13 +7,13 @@
#pragma once
#include "base/message_loop.h"
-#include "net/base/listen_socket.h"
+#include "net/base/tcp_listen_socket.h"
class HttpServerRequestInfo;
class HttpServerResponseInfo;
// Implements a simple HTTP listen socket on top of the raw socket interface.
-class HttpListenSocket : public net::ListenSocket,
+class HttpListenSocket : public net::TCPListenSocket,
public net::ListenSocket::ListenSocketDelegate {
public:
class Delegate {