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

Unified Diff: chrome/test/chromedriver/server/chromedriver_server.cc

Issue 296053012: Replace StreamListenSocket with StreamSocket in HttpServer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unittest errors. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/chromedriver/server/chromedriver_server.cc
diff --git a/chrome/test/chromedriver/server/chromedriver_server.cc b/chrome/test/chromedriver/server/chromedriver_server.cc
index e93091e6228b52c1fb831ba95a000961c259a9d7..2508c59ae50a5e8015c777816844b6f586630b70 100644
--- a/chrome/test/chromedriver/server/chromedriver_server.cc
+++ b/chrome/test/chromedriver/server/chromedriver_server.cc
@@ -33,7 +33,7 @@
#include "net/server/http_server.h"
#include "net/server/http_server_request_info.h"
#include "net/server/http_server_response_info.h"
-#include "net/socket/tcp_listen_socket.h"
+#include "net/socket/tcp_server_socket.h"
namespace {
@@ -55,8 +55,10 @@ class HttpServer : public net::HttpServer::Delegate {
std::string binding_ip = kLocalHostAddress;
if (allow_remote)
binding_ip = "0.0.0.0";
- server_ = new net::HttpServer(
- net::TCPListenSocketFactory(binding_ip, port), this);
+ scoped_ptr<net::ServerSocket> server_socket(
+ new net::TCPServerSocket(NULL, net::NetLog::Source()));
+ server_socket->ListenWithAddressAndPort(binding_ip, port, 1);
+ server_.reset(new net::HttpServer(server_socket.Pass(), this));
net::IPEndPoint address;
return server_->GetLocalAddress(&address) == net::OK;
}
@@ -89,7 +91,7 @@ class HttpServer : public net::HttpServer::Delegate {
}
HttpRequestHandlerFunc handle_request_func_;
- scoped_refptr<net::HttpServer> server_;
+ scoped_ptr<net::HttpServer> server_;
base::WeakPtrFactory<HttpServer> weak_factory_; // Should be last.
};

Powered by Google App Engine
This is Rietveld 408576698