summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorvadimt <vadimt@chromium.org>2014-10-20 15:40:15 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-20 22:41:01 +0000
commita23c1c6d16f59e5adfe79beabb94e18e31a73ab0 (patch)
tree9ed60aca7ede017f6c58d103b51fc2eb0acd1994 /google_apis
parentf898f99146b7cde544c9c10d7cbe9861a6c71bc5 (diff)
downloadchromium_src-a23c1c6d16f59e5adfe79beabb94e18e31a73ab0.zip
chromium_src-a23c1c6d16f59e5adfe79beabb94e18e31a73ab0.tar.gz
chromium_src-a23c1c6d16f59e5adfe79beabb94e18e31a73ab0.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. This CL instruments most popular OnRefreshTokenAvailable overrides. BUG=422460 TBR=jam@chromium.org, zelidrag@chromium.org, erikwright@chromium.org Review URL: https://codereview.chromium.org/643183003 Cr-Commit-Position: refs/heads/master@{#300361}
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/account_tracker.cc6
-rw-r--r--google_apis/gaia/identity_provider.cc6
2 files changed, 12 insertions, 0 deletions
diff --git a/google_apis/gaia/account_tracker.cc b/google_apis/gaia/account_tracker.cc
index 50c4e70..d6476b5 100644
--- a/google_apis/gaia/account_tracker.cc
+++ b/google_apis/gaia/account_tracker.cc
@@ -6,6 +6,7 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
+#include "base/profiler/scoped_profile.h"
#include "base/stl_util.h"
#include "net/url_request/url_request_context_getter.h"
@@ -84,6 +85,11 @@ AccountIds AccountTracker::FindAccountIdsByGaiaId(const std::string& gaia_id) {
}
void AccountTracker::OnRefreshTokenAvailable(const std::string& account_id) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422460 AccountTracker::OnRefreshTokenAvailable"));
+
TRACE_EVENT1("identity",
"AccountTracker::OnRefreshTokenAvailable",
"account_key",
diff --git a/google_apis/gaia/identity_provider.cc b/google_apis/gaia/identity_provider.cc
index 842891e..73abe2a 100644
--- a/google_apis/gaia/identity_provider.cc
+++ b/google_apis/gaia/identity_provider.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/profiler/scoped_profile.h"
#include "google_apis/gaia/identity_provider.h"
IdentityProvider::Observer::~Observer() {}
@@ -39,6 +40,11 @@ void IdentityProvider::RemoveObserver(Observer* observer) {
}
void IdentityProvider::OnRefreshTokenAvailable(const std::string& account_id) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422460 IdentityProvider::OnRefreshTokenAvailable"));
+
if (account_id != GetActiveAccountId())
return;
FOR_EACH_OBSERVER(OAuth2TokenService::Observer,