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

Unified Diff: net/socket/tcp_client_socket.cc

Issue 1062413002: Remove unnecessary instrumentation for several jank bugs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fixes Created 5 years, 8 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/ssl_session_cache_openssl.cc ('k') | net/socket/tcp_socket_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_client_socket.cc
diff --git a/net/socket/tcp_client_socket.cc b/net/socket/tcp_client_socket.cc
index d2241c029506d820d20fcbbe9b26ba6b13df5df8..4a72bdf1d0c93a386a0f50d5d447d62758687a43 100644
--- a/net/socket/tcp_client_socket.cc
+++ b/net/socket/tcp_client_socket.cc
@@ -63,10 +63,6 @@ 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.
@@ -116,42 +112,40 @@ 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()));
const IPEndPoint& endpoint = addresses_[current_address_index_];
- if (previously_disconnected_) {
- use_history_.Reset();
- previously_disconnected_ = false;
- }
+ {
+ // TODO(ricea): Remove ScopedTracker below once crbug.com/436634 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("436634 TCPClientSocket::DoConnect"));
- next_connect_state_ = CONNECT_STATE_CONNECT_COMPLETE;
+ if (previously_disconnected_) {
+ use_history_.Reset();
+ previously_disconnected_ = false;
+ }
- if (socket_->IsValid()) {
- DCHECK(bind_address_);
- } else {
- int result = OpenSocket(endpoint.GetFamily());
- if (result != OK)
- return result;
+ next_connect_state_ = CONNECT_STATE_CONNECT_COMPLETE;
- if (bind_address_) {
- result = socket_->Bind(*bind_address_);
- if (result != OK) {
- socket_->Close();
+ if (socket_->IsValid()) {
+ DCHECK(bind_address_);
+ } else {
+ int result = OpenSocket(endpoint.GetFamily());
+ if (result != OK)
return result;
+
+ if (bind_address_) {
+ result = socket_->Bind(*bind_address_);
+ if (result != OK) {
+ socket_->Close();
+ return result;
+ }
}
}
}
- // 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,
@@ -160,11 +154,6 @@ 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!
« no previous file with comments | « net/socket/ssl_session_cache_openssl.cc ('k') | net/socket/tcp_socket_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698