| Index: content/browser/renderer_host/p2p/socket_host_tcp.cc
|
| diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.cc b/content/browser/renderer_host/p2p/socket_host_tcp.cc
|
| index f88ff4a05718a8b1af94bb3e13519def0babfdbb..db94edc7573d9a0a2d7e9463c36e3040271300e7 100644
|
| --- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
|
| +++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
|
| @@ -21,13 +21,7 @@ namespace content {
|
| P2PSocketHostTcp::P2PSocketHostTcp(IPC::Message::Sender* message_sender,
|
| int routing_id, int id)
|
| : P2PSocketHost(message_sender, routing_id, id),
|
| - connected_(false),
|
| - ALLOW_THIS_IN_INITIALIZER_LIST(
|
| - connect_callback_(this, &P2PSocketHostTcp::OnConnected)),
|
| - ALLOW_THIS_IN_INITIALIZER_LIST(
|
| - read_callback_(this, &P2PSocketHostTcp::OnRead)),
|
| - ALLOW_THIS_IN_INITIALIZER_LIST(
|
| - write_callback_(this, &P2PSocketHostTcp::OnWritten)) {
|
| + connected_(false) {
|
| }
|
|
|
| P2PSocketHostTcp::~P2PSocketHostTcp() {
|
| @@ -68,7 +62,8 @@ bool P2PSocketHostTcp::Init(const net::IPEndPoint& local_address,
|
| if (socket_->SetSendBufferSize(kMaxSendBufferSize))
|
| LOG(WARNING) << "Failed to set send buffer size for TCP socket.";
|
|
|
| - int result = socket_->Connect(&connect_callback_);
|
| + int result = socket_->Connect(
|
| + base::Bind(&P2PSocketHostTcp::OnConnected, base::Unretained(this)));
|
| if (result != net::ERR_IO_PENDING) {
|
| OnConnected(result);
|
| }
|
| @@ -125,7 +120,8 @@ void P2PSocketHostTcp::DoRead() {
|
| read_buffer_->RemainingCapacity());
|
| }
|
| result = socket_->Read(read_buffer_, read_buffer_->RemainingCapacity(),
|
| - &read_callback_);
|
| + base::Bind(&P2PSocketHostTcp::OnRead,
|
| + base::Unretained(this)));
|
| DidCompleteRead(result);
|
| } while (result > 0);
|
| }
|
| @@ -232,7 +228,8 @@ void P2PSocketHostTcp::Send(const net::IPEndPoint& to,
|
| void P2PSocketHostTcp::DoWrite() {
|
| while (true) {
|
| int result = socket_->Write(write_buffer_, write_buffer_->BytesRemaining(),
|
| - &write_callback_);
|
| + base::Bind(&P2PSocketHostTcp::OnWritten,
|
| + base::Unretained(this)));
|
| if (result >= 0) {
|
| write_buffer_->DidConsume(result);
|
| if (write_buffer_->BytesRemaining() == 0) {
|
|
|