Commit 06b0b703 authored by vadimt's avatar vadimt Committed by Commit bot

Instrumenting read callbacks to find jank in TCPSocketWin::Core::ReadDelegate::OnObjectSignaled.

See the bug.

I was told that one of the pieces of code that could cause jank is the callback invoked in IO thread once the read on a socket is complete. I'm not familiar with the code, and I instrumented places that look relevant; feel free to suggest adding or removing the instrumentation.

BUG=418183
TBR=asanka@chromium.org

Review URL: https://codereview.chromium.org/637733002

Cr-Commit-Position: refs/heads/master@{#299176}
parent 3ce896cf
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include "base/profiler/scoped_profile.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
...@@ -2213,6 +2214,10 @@ void SSLClientSocketNSS::Core::DoReadCallback(int rv) { ...@@ -2213,6 +2214,10 @@ void SSLClientSocketNSS::Core::DoReadCallback(int rv) {
PostOrRunCallback( PostOrRunCallback(
FROM_HERE, FROM_HERE,
base::Bind(&Core::DidNSSRead, this, rv)); base::Bind(&Core::DidNSSRead, this, rv));
// TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"SSLClientSocketNSS::Core::DoReadCallback"));
PostOrRunCallback( PostOrRunCallback(
FROM_HERE, FROM_HERE,
base::Bind(base::ResetAndReturn(&user_read_callback_), rv)); base::Bind(base::ResetAndReturn(&user_read_callback_), rv));
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/profiler/scoped_profile.h"
#include "net/base/io_buffer.h" #include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h" #include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
...@@ -306,6 +307,10 @@ void TCPClientSocket::DidCompleteReadWrite(const CompletionCallback& callback, ...@@ -306,6 +307,10 @@ void TCPClientSocket::DidCompleteReadWrite(const CompletionCallback& callback,
if (result > 0) if (result > 0)
use_history_.set_was_used_to_convey_data(); use_history_.set_was_used_to_convey_data();
// TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"TCPClientSocket::DidCompleteReadWrite"));
callback.Run(result); callback.Run(result);
} }
......
...@@ -1035,6 +1035,9 @@ void TCPSocketWin::DidSignalRead() { ...@@ -1035,6 +1035,9 @@ void TCPSocketWin::DidSignalRead() {
core_->read_buffer_length_ = 0; core_->read_buffer_length_ = 0;
DCHECK_NE(rv, ERR_IO_PENDING); DCHECK_NE(rv, ERR_IO_PENDING);
// TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION("TCPSocketWin::DidSignalRead"));
base::ResetAndReturn(&read_callback_).Run(rv); base::ResetAndReturn(&read_callback_).Run(rv);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment