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

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: fixup Created 7 years, 5 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: 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 5abe03b4ae3aa41bf70963f30b24ac4548a0d8cc..cca9ac22837fb06b18d67c228287a103e1eef766 100644
--- a/net/socket/unix_domain_socket_posix_unittest.cc
+++ b/net/socket/unix_domain_socket_posix_unittest.cc
@@ -102,9 +102,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);
}
@@ -138,7 +138,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_;
};
@@ -172,7 +172,7 @@ class UnixDomainSocketTestHelper : public testing::Test {
virtual void TearDown() OVERRIDE {
DeleteSocketFile();
- socket_ = NULL;
+ socket_.reset();
socket_delegate_.reset();
event_manager_ = NULL;
}
@@ -221,7 +221,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 {
@@ -264,7 +264,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);
@@ -280,7 +280,6 @@ TEST_F(UnixDomainSocketTest, TestFallbackName) {
socket_delegate_.get(),
MakeAuthCallback());
EXPECT_FALSE(socket_.get() == NULL);
- existing_socket = NULL;
}
#endif

Powered by Google App Engine
This is Rietveld 408576698