diff options
author | vadimt <vadimt@chromium.org> | 2014-12-30 13:39:40 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-30 21:41:19 +0000 |
commit | 2ce4615599f4c286b9de5da1eaa8c97da421d295 (patch) | |
tree | c645c0ce5cc62e993bd011bdd5bbbbdeaefbd6ce | |
parent | f1e5ad0b7196486430381fb1a0d90860f2917a97 (diff) | |
download | chromium_src-2ce4615599f4c286b9de5da1eaa8c97da421d295.zip chromium_src-2ce4615599f4c286b9de5da1eaa8c97da421d295.tar.gz chromium_src-2ce4615599f4c286b9de5da1eaa8c97da421d295.tar.bz2 |
Instrumenting TCPClientSocket::Connect to find jank.
Prior instrumentations revealed that most of the jank comes from the "transport_socket_->Connect(helper_.on_io_complete());" operator in TransportConnectJob::DoTransportConnect.
Since this socket is most likely TCPClientSocket, instrumenting its "Connect" method.
BUG=436634
Review URL: https://codereview.chromium.org/787913004
Cr-Commit-Position: refs/heads/master@{#309780}
-rw-r--r-- | net/socket/tcp_client_socket.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/net/socket/tcp_client_socket.cc b/net/socket/tcp_client_socket.cc index dcf124b..8eda581 100644 --- a/net/socket/tcp_client_socket.cc +++ b/net/socket/tcp_client_socket.cc @@ -63,6 +63,10 @@ int TCPClientSocket::Bind(const IPEndPoint& address) { } int TCPClientSocket::Connect(const CompletionCallback& callback) { + // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION("436634 TCPClientSocket::Connect")); + DCHECK(!callback.is_null()); // If connecting or already connected, then just return OK. @@ -112,6 +116,10 @@ int TCPClientSocket::DoConnectLoop(int result) { } int TCPClientSocket::DoConnect() { + // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed. + tracked_objects::ScopedTracker tracking_profile1( + FROM_HERE_WITH_EXPLICIT_FUNCTION("436634 TCPClientSocket::DoConnect1")); + DCHECK_GE(current_address_index_, 0); DCHECK_LT(current_address_index_, static_cast<int>(addresses_.size())); @@ -140,6 +148,10 @@ int TCPClientSocket::DoConnect() { } } + // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed. + tracked_objects::ScopedTracker tracking_profile2( + FROM_HERE_WITH_EXPLICIT_FUNCTION("436634 TCPClientSocket::DoConnect2")); + // |socket_| is owned by this class and the callback won't be run once // |socket_| is gone. Therefore, it is safe to use base::Unretained() here. return socket_->Connect(endpoint, @@ -148,6 +160,11 @@ int TCPClientSocket::DoConnect() { } int TCPClientSocket::DoConnectComplete(int result) { + // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "436634 TCPClientSocket::DoConnectComplete")); + if (result == OK) { use_history_.set_was_ever_connected(); return OK; // Done! |