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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp_server.cc

Issue 8771030: base::Bind: Convert ServerSocket::Accept. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test logic fix. Created 9 years 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: content/browser/renderer_host/p2p/socket_host_tcp_server.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc
index 8a19d98f03b8a0572e57a4a4f1fd57e659986495..4c7891a4d88419b612c153a4fde5039874e12bb8 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp_server.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp_server.cc
@@ -4,6 +4,8 @@
#include "content/browser/renderer_host/p2p/socket_host_tcp_server.h"
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/stl_util.h"
#include "content/browser/renderer_host/p2p/socket_host_tcp.h"
#include "content/common/p2p_messages.h"
@@ -24,8 +26,9 @@ P2PSocketHostTcpServer::P2PSocketHostTcpServer(
int routing_id, int id)
: P2PSocketHost(message_sender, routing_id, id),
socket_(new net::TCPServerSocket(NULL, net::NetLog::Source())),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- accept_callback_(this, &P2PSocketHostTcpServer::OnAccepted)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(accept_callback_(
+ base::Bind(&P2PSocketHostTcpServer::OnAccepted,
+ base::Unretained(this)))) {
}
P2PSocketHostTcpServer::~P2PSocketHostTcpServer() {
@@ -76,7 +79,7 @@ void P2PSocketHostTcpServer::OnError() {
void P2PSocketHostTcpServer::DoAccept() {
while (true) {
- int result = socket_->Accept(&accept_socket_, &accept_callback_);
+ int result = socket_->Accept(&accept_socket_, accept_callback_);
if (result == net::ERR_IO_PENDING) {
break;
} else {

Powered by Google App Engine
This is Rietveld 408576698