diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-05 17:21:34 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-05 17:21:34 +0000 |
commit | d6149fded8c3cc8939e244ae6c5d9d076e69a4ab (patch) | |
tree | 093d9d27bf276f0126ccf41ce179729ad57956c4 /net/socket/client_socket_handle.h | |
parent | 7ba53e1db77e3cd7c9e7b05c6e44698a142beea5 (diff) | |
download | chromium_src-d6149fded8c3cc8939e244ae6c5d9d076e69a4ab.zip chromium_src-d6149fded8c3cc8939e244ae6c5d9d076e69a4ab.tar.gz chromium_src-d6149fded8c3cc8939e244ae6c5d9d076e69a4ab.tar.bz2 |
Revert 55071 - Reland 54771 (and 54795) To enable TCP Preconnection by default
Leaks reported with this CL.
http://build.chromium.org/buildbot/memory/builders/Linux%20Heapcheck/builds/6130/steps/heapcheck%20test:%20net/logs/stdio
Eg.
Leak of 24 bytes in 1 objects allocated from:
@ 84aece net::SSLClientSocketNSS::BufferRecv
@ 84b161 net::SSLClientSocketNSS::DoTransportIO
@ 84ca1f net::SSLClientSocketNSS::DoHandshakeLoop
@ 84ca6b net::SSLClientSocketNSS::OnHandshakeIOComplete
@ 84cadc net::SSLClientSocketNSS::OnRecvComplete
@ 84cbb0 net::SSLClientSocketNSS::BufferRecvComplete
@ 84ea4b void DispatchToMethod
@ 84ea7b CallbackImpl::RunWithParams
@ 4b3a10 CallbackRunner::Run
@ 853e7e net::TCPClientSocketLibevent::DoReadCallback
@ 85426f net::TCPClientSocketLibevent::DidCompleteRead
@ 856a5c net::TCPClientSocketLibevent::ReadWatcher::OnFileCanReadWithoutBlocking
@ 93d8fd base::MessagePumpLibevent::FileDescriptorWatcher::OnFileCanReadWithoutBlocking
@ 93d966 base::MessagePumpLibevent::OnLibeventNotification
@ 9da639 event_process_active
@ 9da923 event_base_loop
@ 93dfd0 base::MessagePumpLibevent::Run
@ 8f2873 MessageLoop::RunInternal
@ 8f2893 MessageLoop::RunHandler
@ 8f2938 MessageLoop::Run
@ 44b7f9 TestCompletionCallback::WaitForResult
@ 6a1ee6 SSLClientSocketTest_ConnectMismatched_Test::TestBody
@ 961831 testing::Test::Run
@ 965026 testing::internal::TestInfoImpl::Run
@ 96515c testing::TestCase::Run
@ 965bbe testing::internal::UnitTestImpl::RunAllTests
@ 965d35 testing::UnitTest::Run
@ 4a4bf7 TestSuite::Run
@ 4a3b6d main
@ 2adff5bb11c4 __libc_start_main
Suppression:
{
<insert_a_suppression_name_here>
Heapcheck:Leak
fun:net::SSLClientSocketNSS::BufferRecv
fun:net::SSLClientSocketNSS::DoTransportIO
fun:net::SSLClientSocketNSS::DoHandshakeLoop
fun:net::SSLClientSocketNSS::OnHandshakeIOComplete
fun:net::SSLClientSocketNSS::OnRecvComplete
fun:net::SSLClientSocketNSS::BufferRecvComplete
fun:void DispatchToMethod
fun:CallbackImpl::RunWithParams
fun:CallbackRunner::Run
fun:net::TCPClientSocketLibevent::DoReadCallback
fun:net::TCPClientSocketLibevent::DidCompleteRead
fun:net::TCPClientSocketLibevent::ReadWatcher::OnFileCanReadWithoutBlocking
fun:base::MessagePumpLibevent::FileDescriptorWatcher::OnFileCanReadWithoutBlocking
fun:base::MessagePumpLibevent::OnLibeventNotification
fun:event_process_active
fun:event_base_loop
fun:base::MessagePumpLibevent::Run
fun:MessageLoop::RunInternal
fun:MessageLoop::RunHandler
fun:MessageLoop::Run
fun:TestCompletionCallback::WaitForResult
fun:SSLClientSocketTest_ConnectMismatched_Test::TestBody
fun:testing::Test::Run
fun:testing::internal::TestInfoImpl::Run
fun:testing::TestCase::Run
fun:testing::internal::UnitTestImpl::RunAllTests
fun:testing::UnitTest::Run
fun:TestSuite::Run
fun:main
fun:__libc_start_main
}
I added defensive code in ClientSocketHandle::ReleaseSocket(),
which should preclude the crash that was reported on the
stability bot.
I added a second call to ReleaseSocket() from
~ClientSocketHandle to ensure that we updated the
related ClientSocket when we are torn down.
r=mbelshe
Review URL: http://codereview.chromium.org/3071022
TBR=jar@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55090 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_handle.h')
-rw-r--r-- | net/socket/client_socket_handle.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/net/socket/client_socket_handle.h b/net/socket/client_socket_handle.h index bcb94cb..adccc89 100644 --- a/net/socket/client_socket_handle.h +++ b/net/socket/client_socket_handle.h @@ -132,16 +132,7 @@ class ClientSocketHandle { const std::string& group_name() const { return group_name_; } int id() const { return pool_id_; } ClientSocket* socket() { return socket_.get(); } - ClientSocket* release_socket() { - // Update the base class to record things like whether we've ever - // transmitted data, and whether the connection was able to be established. - // We use this data to construct histograms indicating whether a - // speculative connection was ever used, etc., when the ClientSocket is - // eventually discarded. - if (socket_.get()) - socket_->UpdateConnectivityState(is_reused()); - return socket_.release(); - } + ClientSocket* release_socket() { return socket_.release(); } bool is_reused() const { return is_reused_; } base::TimeDelta idle_time() const { return idle_time_; } SocketReuseType reuse_type() const { |