| Index: net/socket/tcp_listen_socket_unittest.cc
|
| diff --git a/net/socket/tcp_listen_socket_unittest.cc b/net/socket/tcp_listen_socket_unittest.cc
|
| index d13b784cbdcef3f53f04248b00262bb211d3a116..3fffd16974237ae55ad5b936d71e3a35c122c364 100644
|
| --- a/net/socket/tcp_listen_socket_unittest.cc
|
| +++ b/net/socket/tcp_listen_socket_unittest.cc
|
| @@ -24,7 +24,7 @@ static const char kLoopback[] = "127.0.0.1";
|
| static const int kDefaultTimeoutMs = 5000;
|
|
|
| TCPListenSocketTester::TCPListenSocketTester()
|
| - : loop_(NULL), server_(NULL), connection_(NULL), cv_(&lock_) {}
|
| + : loop_(NULL), cv_(&lock_) {}
|
|
|
| void TCPListenSocketTester::SetUp() {
|
| base::Thread::Options options;
|
| @@ -113,17 +113,14 @@ int TCPListenSocketTester::ClearTestSocket() {
|
| }
|
|
|
| void TCPListenSocketTester::Shutdown() {
|
| - connection_->Release();
|
| - connection_ = NULL;
|
| - server_->Release();
|
| - server_ = NULL;
|
| + connection_.reset();
|
| + server_.reset();
|
| ReportAction(TCPListenSocketTestAction(ACTION_SHUTDOWN));
|
| }
|
|
|
| void TCPListenSocketTester::Listen() {
|
| server_ = DoListen();
|
| ASSERT_TRUE(server_.get());
|
| - server_->AddRef();
|
| ReportAction(TCPListenSocketTestAction(ACTION_LISTEN));
|
| }
|
|
|
| @@ -227,10 +224,10 @@ bool TCPListenSocketTester::Send(SocketDescriptor sock,
|
| return true;
|
| }
|
|
|
| -void TCPListenSocketTester::DidAccept(StreamListenSocket* server,
|
| - StreamListenSocket* connection) {
|
| - connection_ = connection;
|
| - connection_->AddRef();
|
| +void TCPListenSocketTester::DidAccept(
|
| + StreamListenSocket* server,
|
| + scoped_ptr<StreamListenSocket> connection) {
|
| + connection_ = connection.Pass();
|
| ReportAction(TCPListenSocketTestAction(ACTION_ACCEPT));
|
| }
|
|
|
| @@ -247,7 +244,7 @@ void TCPListenSocketTester::DidClose(StreamListenSocket* sock) {
|
|
|
| TCPListenSocketTester::~TCPListenSocketTester() {}
|
|
|
| -scoped_refptr<TCPListenSocket> TCPListenSocketTester::DoListen() {
|
| +scoped_ptr<TCPListenSocket> TCPListenSocketTester::DoListen() {
|
| return TCPListenSocket::CreateAndListen(kLoopback, kTestPort, this);
|
| }
|
|
|
|
|