summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorvadimt <vadimt@chromium.org>2014-12-30 14:17:47 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-30 22:18:35 +0000
commit6f25e7abcbb96a0c5eefae918f0302f7d89e21b0 (patch)
tree94d3891aaf90d4ca9af54b1b2db2f6cf6ae9c520 /net
parent7c9665ef172a0260ac0b06040a9459026121cdde (diff)
downloadchromium_src-6f25e7abcbb96a0c5eefae918f0302f7d89e21b0.zip
chromium_src-6f25e7abcbb96a0c5eefae918f0302f7d89e21b0.tar.gz
chromium_src-6f25e7abcbb96a0c5eefae918f0302f7d89e21b0.tar.bz2
Instrumenting ReadRawData and InformDelegateDownloadProgress to find jank.
Prior instrumentations showed that: ReadRawData = 16 jph InformDelegateDownloadProgress = 4.8 jph Instrumenting deeper. The jank in InformDelegateDownloadProgress is a surprise since this method does nothing but posting a task. But still, who knows, and I'm instrumenting it too. BUG=423948 TBR=jianli@chromium.org, jhawkins@chromium.org, zork@chromium.org, jochen@chromium.org, tzik@chromium.org Review URL: https://codereview.chromium.org/821073003 Cr-Commit-Position: refs/heads/master@{#309783}
Diffstat (limited to 'net')
-rw-r--r--net/url_request/url_fetcher_core.cc11
-rw-r--r--net/url_request/url_request_file_dir_job.cc6
-rw-r--r--net/url_request/url_request_file_job.cc5
-rw-r--r--net/url_request/url_request_ftp_job.cc5
-rw-r--r--net/url_request/url_request_http_job.cc14
5 files changed, 40 insertions, 1 deletions
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index 420e831..c9f028f 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -931,7 +931,18 @@ void URLFetcherCore::InformDelegateUploadProgressInDelegateThread(
}
void URLFetcherCore::InformDelegateDownloadProgress() {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
+ tracked_objects::ScopedTracker tracking_profile1(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "423948 URLFetcherCore::InformDelegateDownloadProgress1"));
+
DCHECK(network_task_runner_->BelongsToCurrentThread());
+
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
+ tracked_objects::ScopedTracker tracking_profile2(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "423948 URLFetcherCore::InformDelegateDownloadProgress2"));
+
delegate_task_runner_->PostTask(
FROM_HERE,
base::Bind(
diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc
index da586f3..d999c4f 100644
--- a/net/url_request/url_request_file_dir_job.cc
+++ b/net/url_request/url_request_file_dir_job.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/message_loop/message_loop.h"
+#include "base/profiler/scoped_tracker.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
@@ -67,6 +68,11 @@ void URLRequestFileDirJob::Kill() {
bool URLRequestFileDirJob::ReadRawData(IOBuffer* buf, int buf_size,
int* bytes_read) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "423948 URLRequestFileDirJob::ReadRawData"));
+
DCHECK(bytes_read);
*bytes_read = 0;
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index 7b3b195..5b01e50 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -87,6 +87,11 @@ void URLRequestFileJob::Kill() {
bool URLRequestFileJob::ReadRawData(IOBuffer* dest,
int dest_size,
int* bytes_read) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "423948 URLRequestFileJob::ReadRawData"));
+
DCHECK_NE(dest_size, 0);
DCHECK(bytes_read);
DCHECK_GE(remaining_bytes_, 0);
diff --git a/net/url_request/url_request_ftp_job.cc b/net/url_request/url_request_ftp_job.cc
index 09c6f0f..d774714 100644
--- a/net/url_request/url_request_ftp_job.cc
+++ b/net/url_request/url_request_ftp_job.cc
@@ -6,6 +6,7 @@
#include "base/compiler_specific.h"
#include "base/message_loop/message_loop.h"
+#include "base/profiler/scoped_tracker.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/auth.h"
#include "net/base/host_port_pair.h"
@@ -349,6 +350,10 @@ UploadProgress URLRequestFtpJob::GetUploadProgress() const {
bool URLRequestFtpJob::ReadRawData(IOBuffer* buf,
int buf_size,
int *bytes_read) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION("423948 URLRequestFtpJob::ReadRawData"));
+
DCHECK_NE(buf_size, 0);
DCHECK(bytes_read);
DCHECK(!read_in_progress_);
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index acf1d07..8531dd3 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -1281,6 +1281,11 @@ bool URLRequestHttpJob::ShouldFixMismatchedContentLength(int rv) const {
bool URLRequestHttpJob::ReadRawData(IOBuffer* buf, int buf_size,
int* bytes_read) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
+ tracked_objects::ScopedTracker tracking_profile1(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "423948 URLRequestHttpJob::ReadRawData1"));
+
DCHECK_NE(buf_size, 0);
DCHECK(bytes_read);
DCHECK(!read_in_progress_);
@@ -1294,8 +1299,15 @@ bool URLRequestHttpJob::ReadRawData(IOBuffer* buf, int buf_size,
if (rv >= 0) {
*bytes_read = rv;
- if (!rv)
+ if (!rv) {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is
+ // fixed.
+ tracked_objects::ScopedTracker tracking_profile2(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "423948 URLRequestHttpJob::ReadRawData2"));
+
DoneWithRequest(FINISHED);
+ }
return true;
}