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

Unified Diff: cloud_print/gcp20/prototype/privet_http_server.cc

Issue 497223003: Revert of Replace StreamListenSocket with StreamSocket in HttpServer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: cloud_print/gcp20/prototype/privet_http_server.cc
diff --git a/cloud_print/gcp20/prototype/privet_http_server.cc b/cloud_print/gcp20/prototype/privet_http_server.cc
index 41daa812687753fb36f3068ed1d1b200e3f88b11..9aa2835d19541658898f7fb87a19a2ed04a37c8f 100644
--- a/cloud_print/gcp20/prototype/privet_http_server.cc
+++ b/cloud_print/gcp20/prototype/privet_http_server.cc
@@ -10,7 +10,7 @@
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/url_util.h"
-#include "net/socket/tcp_server_socket.h"
+#include "net/socket/tcp_listen_socket.h"
#include "url/gurl.h"
namespace {
@@ -105,12 +105,10 @@
if (server_)
return true;
- scoped_ptr<net::ServerSocket> server_socket(
- new net::TCPServerSocket(NULL, net::NetLog::Source()));
- server_socket->ListenWithAddressAndPort("0.0.0.0", port, 1);
- server_.reset(new net::HttpServer(server_socket.Pass(), this));
-
+ net::TCPListenSocketFactory factory("0.0.0.0", port);
+ server_ = new net::HttpServer(factory, this);
net::IPEndPoint address;
+
if (server_->GetLocalAddress(&address) != net::OK) {
NOTREACHED() << "Cannot start HTTP server";
return false;
@@ -124,7 +122,7 @@
if (!server_)
return;
- server_.reset(NULL);
+ server_ = NULL;
}
void PrivetHttpServer::OnHttpRequest(int connection_id,
« no previous file with comments | « cloud_print/gcp20/prototype/privet_http_server.h ('k') | content/browser/devtools/devtools_browser_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698