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

Unified Diff: net/socket/unix_domain_socket_posix_unittest.cc

Issue 20142003: Remove ref-counting from StreamListenSocket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 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
« no previous file with comments | « net/socket/unix_domain_socket_posix.cc ('k') | net/test/embedded_test_server/embedded_test_server.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/unix_domain_socket_posix_unittest.cc
diff --git a/net/socket/unix_domain_socket_posix_unittest.cc b/net/socket/unix_domain_socket_posix_unittest.cc
index 65fda0498cdd3bbd444a1fd60e03cbc4c4f28098..f062d2742053028e9e14c146f47bc2a5268cb158 100644
--- a/net/socket/unix_domain_socket_posix_unittest.cc
+++ b/net/socket/unix_domain_socket_posix_unittest.cc
@@ -103,9 +103,9 @@ class TestListenSocketDelegate : public StreamListenSocket::Delegate {
: event_manager_(event_manager) {}
virtual void DidAccept(StreamListenSocket* server,
- StreamListenSocket* connection) OVERRIDE {
+ scoped_ptr<StreamListenSocket> connection) OVERRIDE {
LOG(ERROR) << __PRETTY_FUNCTION__;
- connection_ = connection;
+ connection_ = connection.Pass();
Notify(EVENT_ACCEPT);
}
@@ -139,7 +139,7 @@ class TestListenSocketDelegate : public StreamListenSocket::Delegate {
}
const scoped_refptr<EventManager> event_manager_;
- scoped_refptr<StreamListenSocket> connection_;
+ scoped_ptr<StreamListenSocket> connection_;
base::Lock mutex_;
string data_;
};
@@ -173,7 +173,7 @@ class UnixDomainSocketTestHelper : public testing::Test {
virtual void TearDown() OVERRIDE {
DeleteSocketFile();
- socket_ = NULL;
+ socket_.reset();
socket_delegate_.reset();
event_manager_ = NULL;
}
@@ -222,7 +222,7 @@ class UnixDomainSocketTestHelper : public testing::Test {
const bool allow_user_;
scoped_refptr<EventManager> event_manager_;
scoped_ptr<TestListenSocketDelegate> socket_delegate_;
- scoped_refptr<UnixDomainSocket> socket_;
+ scoped_ptr<UnixDomainSocket> socket_;
};
class UnixDomainSocketTest : public UnixDomainSocketTestHelper {
@@ -265,7 +265,7 @@ TEST_F(UnixDomainSocketTestWithInvalidPath,
}
TEST_F(UnixDomainSocketTest, TestFallbackName) {
- scoped_refptr<UnixDomainSocket> existing_socket =
+ scoped_ptr<UnixDomainSocket> existing_socket =
UnixDomainSocket::CreateAndListenWithAbstractNamespace(
file_path_.value(), "", socket_delegate_.get(), MakeAuthCallback());
EXPECT_FALSE(existing_socket.get() == NULL);
@@ -281,7 +281,6 @@ TEST_F(UnixDomainSocketTest, TestFallbackName) {
socket_delegate_.get(),
MakeAuthCallback());
EXPECT_FALSE(socket_.get() == NULL);
- existing_socket = NULL;
}
#endif
« no previous file with comments | « net/socket/unix_domain_socket_posix.cc ('k') | net/test/embedded_test_server/embedded_test_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698