summaryrefslogtreecommitdiffstats
path: root/net/tools
diff options
context:
space:
mode:
authorrkn@chromium.org <rkn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-23 20:30:33 +0000
committerrkn@chromium.org <rkn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-23 20:30:33 +0000
commitff04c53708ec68d1f6b1aefa2d44df1725cdf7eb (patch)
treeb0b3dc40223111a4440a56b5d3b279e5b92bd310 /net/tools
parentfd0719894fe7432eec3155bd23cfab4bb22d4595 (diff)
downloadchromium_src-ff04c53708ec68d1f6b1aefa2d44df1725cdf7eb.zip
chromium_src-ff04c53708ec68d1f6b1aefa2d44df1725cdf7eb.tar.gz
chromium_src-ff04c53708ec68d1f6b1aefa2d44df1725cdf7eb.tar.bz2
Moved the ListenSocket class (found in net/base/listen_socket.h) to the net namespace.
BUG=87032 TEST=None Review URL: http://codereview.chromium.org/7190041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90257 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r--net/tools/fetch/http_listen_socket.cc24
-rw-r--r--net/tools/fetch/http_listen_socket.h16
2 files changed, 21 insertions, 19 deletions
diff --git a/net/tools/fetch/http_listen_socket.cc b/net/tools/fetch/http_listen_socket.cc
index 78d924d..fc9f5f3 100644
--- a/net/tools/fetch/http_listen_socket.cc
+++ b/net/tools/fetch/http_listen_socket.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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(ListenSocket(s, this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(net::ListenSocket(s, this)),
delegate_(delegate) {
}
@@ -25,13 +25,13 @@ HttpListenSocket::~HttpListenSocket() {
}
void HttpListenSocket::Listen() {
- ListenSocket::Listen();
+ net::ListenSocket::Listen();
}
void HttpListenSocket::Accept() {
- SOCKET conn = ListenSocket::Accept(socket_);
- DCHECK_NE(conn, ListenSocket::kInvalidSocket);
- if (conn == ListenSocket::kInvalidSocket) {
+ SOCKET conn = net::ListenSocket::Accept(socket_);
+ DCHECK_NE(conn, net::ListenSocket::kInvalidSocket);
+ if (conn == net::ListenSocket::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 = ListenSocket::Listen(ip, port);
- if (s == ListenSocket::kInvalidSocket) {
+ SOCKET s = net::ListenSocket::Listen(ip, port);
+ if (s == net::ListenSocket::kInvalidSocket) {
// TODO (ibrar): error handling
} else {
HttpListenSocket *serv = new HttpListenSocket(s, delegate);
@@ -185,12 +185,12 @@ HttpServerRequestInfo* HttpListenSocket::ParseHeaders() {
return NULL;
}
-void HttpListenSocket::DidAccept(ListenSocket* server,
- ListenSocket* connection) {
+void HttpListenSocket::DidAccept(net::ListenSocket* server,
+ net::ListenSocket* connection) {
connection->AddRef();
}
-void HttpListenSocket::DidRead(ListenSocket* connection,
+void HttpListenSocket::DidRead(net::ListenSocket* connection,
const char* data,
int len) {
recv_data_.append(data, len);
@@ -203,7 +203,7 @@ void HttpListenSocket::DidRead(ListenSocket* connection,
}
}
-void HttpListenSocket::DidClose(ListenSocket* sock) {
+void HttpListenSocket::DidClose(net::ListenSocket* sock) {
sock->Release();
}
diff --git a/net/tools/fetch/http_listen_socket.h b/net/tools/fetch/http_listen_socket.h
index 82f5312..4d20e1d 100644
--- a/net/tools/fetch/http_listen_socket.h
+++ b/net/tools/fetch/http_listen_socket.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -13,8 +13,8 @@ class HttpServerRequestInfo;
class HttpServerResponseInfo;
// Implements a simple HTTP listen socket on top of the raw socket interface.
-class HttpListenSocket : public ListenSocket,
- public ListenSocket::ListenSocketDelegate {
+class HttpListenSocket : public net::ListenSocket,
+ public net::ListenSocket::ListenSocketDelegate {
public:
class Delegate {
public:
@@ -36,12 +36,14 @@ class HttpListenSocket : public ListenSocket,
void Respond(HttpServerResponseInfo* info, std::string& data);
// ListenSocketDelegate
- virtual void DidAccept(ListenSocket* server, ListenSocket* connection);
- virtual void DidRead(ListenSocket* connection, const char* data, int len);
- virtual void DidClose(ListenSocket* sock);
+ virtual void DidAccept(net::ListenSocket* server,
+ net::ListenSocket* connection);
+ virtual void DidRead(net::ListenSocket* connection,
+ const char* data, int len);
+ virtual void DidClose(net::ListenSocket* sock);
private:
- friend class base::RefCountedThreadSafe<ListenSocket>;
+ friend class base::RefCountedThreadSafe<net::ListenSocket>;
static const int kReadBufSize = 16 * 1024;
HttpListenSocket(SOCKET s, HttpListenSocket::Delegate* del);