diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-17 07:58:05 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-17 07:58:05 +0000 |
commit | fe4f06d49ddccb4f18d9056b85417eb925342ae9 (patch) | |
tree | ff1ffa6d71a2a3a344244bfb1dfbac60ebf13d78 /net/tools | |
parent | 75b91f92b7adfd5fca50369a6717047d787355b3 (diff) | |
download | chromium_src-fe4f06d49ddccb4f18d9056b85417eb925342ae9.zip chromium_src-fe4f06d49ddccb4f18d9056b85417eb925342ae9.tar.gz chromium_src-fe4f06d49ddccb4f18d9056b85417eb925342ae9.tar.bz2 |
Compile fetch_server on POSIX.
More tidy cross-platformness (typedefs instead of #defines) and other simple related cleanups.
TEST=none
http://crbug.com/14191
Review URL: http://codereview.chromium.org/126218
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18607 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/tools')
-rw-r--r-- | net/tools/fetch/fetch_server.cc | 2 | ||||
-rw-r--r-- | net/tools/fetch/http_listen_socket.cc | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/net/tools/fetch/fetch_server.cc b/net/tools/fetch/fetch_server.cc index ed284f9..5e23fbe 100644 --- a/net/tools/fetch/fetch_server.cc +++ b/net/tools/fetch/fetch_server.cc @@ -27,7 +27,9 @@ int main(int argc, char**argv) { StatsTable table("fetchserver", 50, 1000);
table.set_current(&table);
+#if defined(OS_WIN)
net::EnsureWinsockInit();
+#endif // defined(OS_WIN)
CommandLine::Init(0, NULL);
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
diff --git a/net/tools/fetch/http_listen_socket.cc b/net/tools/fetch/http_listen_socket.cc index e64a5f2..c04720e 100644 --- a/net/tools/fetch/http_listen_socket.cc +++ b/net/tools/fetch/http_listen_socket.cc @@ -3,6 +3,7 @@ // found in the LICENSE file.
#include "base/compiler_specific.h"
+#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_util.h"
#include "net/tools/fetch/http_listen_socket.h"
@@ -10,8 +11,8 @@ #include "net/tools/fetch/http_server_response_info.h"
// must run in the IO thread
-HttpListenSocket::HttpListenSocket(SOCKET s,
- HttpListenSocket::Delegate* delegate)
+HttpListenSocket::HttpListenSocket(SOCKET s,
+ HttpListenSocket::Delegate* delegate)
: ALLOW_THIS_IN_INITIALIZER_LIST(ListenSocket(s, this)),
delegate_(delegate) {
}
@@ -22,8 +23,8 @@ HttpListenSocket::~HttpListenSocket() { void HttpListenSocket::Accept() {
SOCKET conn = ListenSocket::Accept(socket_);
- DCHECK(conn != INVALID_SOCKET);
- if (conn == INVALID_SOCKET) {
+ DCHECK_NE(conn, ListenSocket::kInvalidSocket);
+ if (conn == ListenSocket::kInvalidSocket) {
// TODO
} else {
scoped_refptr<HttpListenSocket> sock =
@@ -36,7 +37,7 @@ void HttpListenSocket::Accept() { HttpListenSocket* HttpListenSocket::Listen(const std::string& ip, int port,
HttpListenSocket::Delegate* delegate) {
SOCKET s = ListenSocket::Listen(ip, port);
- if (s == INVALID_SOCKET) {
+ if (s == ListenSocket::kInvalidSocket) {
// TODO (ibrar): error handling
} else {
HttpListenSocket *serv = new HttpListenSocket(s, delegate);
|