summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorvadimt <vadimt@chromium.org>2014-10-13 14:24:54 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-13 21:25:03 +0000
commit910cb95ddc2e0c0f7fa751800bb483106ea74a35 (patch)
tree387680c9907d3e14cf2f334aeb377c0fce279728 /net
parent093e4d52197ecc819e8b33840e4bc44e4aaf0e5b (diff)
downloadchromium_src-910cb95ddc2e0c0f7fa751800bb483106ea74a35.zip
chromium_src-910cb95ddc2e0c0f7fa751800bb483106ea74a35.tar.gz
chromium_src-910cb95ddc2e0c0f7fa751800bb483106ea74a35.tar.bz2
Adding instrumentation to locate the source of jankiness.
Mechanical change that adds instrumentation required to locate the source of jankiness (i.e. a long-running fragment of code executed as a part of the task that causes jank) in the code. See the bug for details on what kind of jank we are after. A number of similar CLs were landed, and none of them caused issues. The code of the instrumentation is highly optimized and is not expected to affect performance. The code simply creates a diagnostic task which is identical to ones created by PostTask or IPC message handlers. Landing as TBR since this is a mechanical, safe and temporary change. BUG=422489 TBR=asanka@chromium.org Review URL: https://codereview.chromium.org/654683002 Cr-Commit-Position: refs/heads/master@{#299365}
Diffstat (limited to 'net')
-rw-r--r--net/url_request/url_request_simple_job.cc32
1 files changed, 28 insertions, 4 deletions
diff --git a/net/url_request/url_request_simple_job.cc b/net/url_request/url_request_simple_job.cc
index f266e3b..a02da27 100644
--- a/net/url_request/url_request_simple_job.cc
+++ b/net/url_request/url_request_simple_job.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/message_loop/message_loop.h"
+#include "base/profiler/scoped_profile.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
@@ -60,6 +61,11 @@ void URLRequestSimpleJob::StartAsync() {
return;
if (ranges().size() > 1) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 1"));
+
NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
ERR_REQUEST_RANGE_NOT_SATISFIABLE));
return;
@@ -68,11 +74,29 @@ void URLRequestSimpleJob::StartAsync() {
if (!ranges().empty() && range_parse_result() == OK)
byte_range_ = ranges().front();
- int result = GetData(&mime_type_, &charset_, &data_,
- base::Bind(&URLRequestSimpleJob::OnGetDataCompleted,
- weak_factory_.GetWeakPtr()));
- if (result != ERR_IO_PENDING)
+ int result;
+ {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ // Remove the block and assign 'result' in its declaration.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 2"));
+
+ result = GetData(&mime_type_,
+ &charset_,
+ &data_,
+ base::Bind(&URLRequestSimpleJob::OnGetDataCompleted,
+ weak_factory_.GetWeakPtr()));
+ }
+
+ if (result != ERR_IO_PENDING) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422489 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422489 URLRequestSimpleJob::StartAsync 3"));
+
OnGetDataCompleted(result);
+ }
}
void URLRequestSimpleJob::OnGetDataCompleted(int result) {