diff options
author | vadimt <vadimt@chromium.org> | 2014-10-10 19:17:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-11 02:17:35 +0000 |
commit | 7faaa25711b1ded3674bda660b84fb47f22632e8 (patch) | |
tree | 23ab9905b676c6b46e6f46b7a9107c6d6d1aeb14 /google_apis | |
parent | 2b628ae2ef33a0ffaa89e7522125b807186b3c69 (diff) | |
download | chromium_src-7faaa25711b1ded3674bda660b84fb47f22632e8.zip chromium_src-7faaa25711b1ded3674bda660b84fb47f22632e8.tar.gz chromium_src-7faaa25711b1ded3674bda660b84fb47f22632e8.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 a part of overloads of URLFetcherDelegate::OnURLFetchComplete. More overloads will be instrumented if the source of the jank is not in one of instrumented methods.
BUG=422577
TBR=mek@chromium.org, toyoshim@chromium.org, dconnelly@chromium.org, pkasting@chromium.org, mmenke@chromium.org, zea@chromium.org, dcheng@chromium.org, noelutz@google.com, thestig@chromium.org, zelidrag@chromium.org
Review URL: https://codereview.chromium.org/648873003
Cr-Commit-Position: refs/heads/master@{#299230}
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/gaia/gaia_auth_fetcher.cc | 6 | ||||
-rw-r--r-- | google_apis/gaia/gaia_oauth_client.cc | 6 | ||||
-rw-r--r-- | google_apis/gaia/oauth2_access_token_fetcher_impl.cc | 6 | ||||
-rw-r--r-- | google_apis/gaia/oauth2_api_call_flow.cc | 6 |
4 files changed, 24 insertions, 0 deletions
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc index e474395..83dae59e 100644 --- a/google_apis/gaia/gaia_auth_fetcher.cc +++ b/google_apis/gaia/gaia_auth_fetcher.cc @@ -10,6 +10,7 @@ #include "base/json/json_reader.h" #include "base/json/json_writer.h" +#include "base/profiler/scoped_profile.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -934,6 +935,11 @@ void GaiaAuthFetcher::OnGetCheckConnectionInfoFetched( } void GaiaAuthFetcher::OnURLFetchComplete(const net::URLFetcher* source) { + // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed. + tracked_objects::ScopedProfile tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422577 GaiaAuthFetcher::OnURLFetchComplete")); + fetch_pending_ = false; // Some of the GAIA requests perform redirects, which results in the final // URL of the fetcher not being the original URL requested. Therefore use diff --git a/google_apis/gaia/gaia_oauth_client.cc b/google_apis/gaia/gaia_oauth_client.cc index b6c0d2e..8f2565e 100644 --- a/google_apis/gaia/gaia_oauth_client.cc +++ b/google_apis/gaia/gaia_oauth_client.cc @@ -7,6 +7,7 @@ #include "base/json/json_reader.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" +#include "base/profiler/scoped_profile.h" #include "base/strings/string_util.h" #include "base/values.h" #include "google_apis/gaia/gaia_urls.h" @@ -226,6 +227,11 @@ void GaiaOAuthClient::Core::MakeGaiaRequest( // URLFetcher::Delegate implementation. void GaiaOAuthClient::Core::OnURLFetchComplete( const net::URLFetcher* source) { + // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed. + tracked_objects::ScopedProfile tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422577 GaiaOAuthClient::Core::OnURLFetchComplete")); + bool should_retry = false; HandleResponse(source, &should_retry); if (should_retry) { diff --git a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc index 08e45d2..7ef13ab 100644 --- a/google_apis/gaia/oauth2_access_token_fetcher_impl.cc +++ b/google_apis/gaia/oauth2_access_token_fetcher_impl.cc @@ -11,6 +11,7 @@ #include "base/json/json_reader.h" #include "base/metrics/histogram.h" #include "base/metrics/sparse_histogram.h" +#include "base/profiler/scoped_profile.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" @@ -258,6 +259,11 @@ void OAuth2AccessTokenFetcherImpl::OnGetTokenFailure( void OAuth2AccessTokenFetcherImpl::OnURLFetchComplete( const net::URLFetcher* source) { + // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed. + tracked_objects::ScopedProfile tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422577 OAuth2AccessTokenFetcherImpl::OnURLFetchComplete")); + CHECK(source); CHECK(state_ == GET_ACCESS_TOKEN_STARTED); EndGetAccessToken(source); diff --git a/google_apis/gaia/oauth2_api_call_flow.cc b/google_apis/gaia/oauth2_api_call_flow.cc index bfb6cb2..2b3d685 100644 --- a/google_apis/gaia/oauth2_api_call_flow.cc +++ b/google_apis/gaia/oauth2_api_call_flow.cc @@ -8,6 +8,7 @@ #include <vector> #include "base/basictypes.h" +#include "base/profiler/scoped_profile.h" #include "base/strings/stringprintf.h" #include "google_apis/gaia/gaia_urls.h" #include "google_apis/gaia/oauth2_access_token_fetcher_impl.h" @@ -137,6 +138,11 @@ OAuth2AccessTokenFetcher* OAuth2ApiCallFlow::CreateAccessTokenFetcher() { } void OAuth2ApiCallFlow::OnURLFetchComplete(const net::URLFetcher* source) { + // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed. + tracked_objects::ScopedProfile tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422577 OAuth2ApiCallFlow::OnURLFetchComplete")); + CHECK(source); CHECK_EQ(API_CALL_STARTED, state_); EndApiCall(source); |