summaryrefslogtreecommitdiffstats
path: root/content/browser/service_worker/service_worker_cache.cc
diff options
context:
space:
mode:
authorvadimt <vadimt@chromium.org>2014-11-18 11:42:31 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-18 19:43:47 +0000
commit81ef0df2b58b26110066d43ea6a55f9f23926aea (patch)
tree831c516bbf18bd0d93a09b2695aef6d5e16d8882 /content/browser/service_worker/service_worker_cache.cc
parent21e18d44689564c84a4e2e8de84ee81619fe72c6 (diff)
downloadchromium_src-81ef0df2b58b26110066d43ea6a55f9f23926aea.zip
chromium_src-81ef0df2b58b26110066d43ea6a55f9f23926aea.tar.gz
chromium_src-81ef0df2b58b26110066d43ea6a55f9f23926aea.tar.bz2
Adding instrumentation to locate the source of jankiness.
Please see the bug for the context. Prior instrumentations showed: The jank happens in more than 1 place: URLRequest::Delegate::OnResponseStarted 34.3 jph NetworkDelegate::OnRawBytesRead 16.4 jph URLRequest::Delegate::OnReadCompleted 7.62 jph ... (the list continues, but further jankiness numbers are quite low) I need to instrument the code inside it to find out which part causes jank. This is a 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. They've helped to find and fix janky code. 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. The task gets created only in developer build and in Canary channel. BUG=423948 TBR=jianli,danakj,jhawkins Review URL: https://codereview.chromium.org/732633002 Cr-Commit-Position: refs/heads/master@{#304653}
Diffstat (limited to 'content/browser/service_worker/service_worker_cache.cc')
-rw-r--r--content/browser/service_worker/service_worker_cache.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/content/browser/service_worker/service_worker_cache.cc b/content/browser/service_worker/service_worker_cache.cc
index e2796e4..5283a08 100644
--- a/content/browser/service_worker/service_worker_cache.cc
+++ b/content/browser/service_worker/service_worker_cache.cc
@@ -9,6 +9,7 @@
#include "base/files/file_path.h"
#include "base/guid.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "base/profiler/scoped_tracker.h"
#include "base/strings/string_util.h"
#include "content/browser/service_worker/service_worker_cache.pb.h"
#include "content/public/browser/browser_thread.h"
@@ -216,6 +217,11 @@ class ServiceWorkerCache::BlobReader : public net::URLRequest::Delegate {
}
void OnResponseStarted(net::URLRequest* request) override {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "423948 ServiceWorkerCache::BlobReader::OnResponseStarted"));
+
if (!request->status().is_success()) {
callback_.Run(entry_.Pass(), false);
return;
@@ -232,6 +238,11 @@ class ServiceWorkerCache::BlobReader : public net::URLRequest::Delegate {
}
void OnReadCompleted(net::URLRequest* request, int bytes_read) override {
+ // TODO(vadimt): Remove ScopedTracker below once crbug.com/423948 is fixed.
+ tracked_objects::ScopedTracker tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "423948 ServiceWorkerCache::BlobReader::OnReadCompleted"));
+
if (!request->status().is_success()) {
callback_.Run(entry_.Pass(), false);
return;