diff options
author | robliao <robliao@chromium.org> | 2015-03-12 18:29:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-13 01:30:03 +0000 |
commit | 66fe8b19210a6cf2618879e2336c6f1608dce8c2 (patch) | |
tree | 976841b7cd6ee5f5386c022f0bb41e52a26b89d3 /google_apis | |
parent | 35761439b1efc9b3eebaf0e18ec8b843677970a8 (diff) | |
download | chromium_src-66fe8b19210a6cf2618879e2336c6f1608dce8c2.zip chromium_src-66fe8b19210a6cf2618879e2336c6f1608dce8c2.tar.gz chromium_src-66fe8b19210a6cf2618879e2336c6f1608dce8c2.tar.bz2 |
Reintroduce WebDataRequestManager::RequestCompletedOnThread Jank Instrumentation
422460 is janky again at 15.2 janks per hour in the most recent run as of this writing. Reintroducing the instrumentation so we can start tracking this again.
Reintroduction synced and adapted from
https://crrev.com/c571107b9edb9d666d7bcfa7d371ba366b4a4afb
BUG=422460
TBR=rogerta
Review URL: https://codereview.chromium.org/990933003
Cr-Commit-Position: refs/heads/master@{#320423}
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/gaia/account_tracker.cc | 53 | ||||
-rw-r--r-- | google_apis/gaia/identity_provider.cc | 7 | ||||
-rw-r--r-- | google_apis/gaia/oauth2_token_service.cc | 43 |
3 files changed, 102 insertions, 1 deletions
diff --git a/google_apis/gaia/account_tracker.cc b/google_apis/gaia/account_tracker.cc index c3653ac..f424863 100644 --- a/google_apis/gaia/account_tracker.cc +++ b/google_apis/gaia/account_tracker.cc @@ -5,6 +5,7 @@ #include "google_apis/gaia/account_tracker.h" #include "base/logging.h" +#include "base/profiler/scoped_tracker.h" #include "base/stl_util.h" #include "base/trace_event/trace_event.h" #include "net/url_request/url_request_context_getter.h" @@ -84,6 +85,12 @@ AccountIds AccountTracker::FindAccountIdsByGaiaId(const std::string& gaia_id) { } void AccountTracker::OnRefreshTokenAvailable(const std::string& account_id) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 AccountTracker::OnRefreshTokenAvailable")); + TRACE_EVENT1("identity", "AccountTracker::OnRefreshTokenAvailable", "account_key", @@ -158,6 +165,12 @@ void AccountTracker::NotifyAccountRemoved(const AccountState& account) { } void AccountTracker::NotifySignInChanged(const AccountState& account) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 AccountTracker::NotifySignInChanged")); + DCHECK(!account.ids.gaia.empty()); FOR_EACH_OBSERVER(Observer, observer_list_, @@ -166,6 +179,12 @@ void AccountTracker::NotifySignInChanged(const AccountState& account) { void AccountTracker::UpdateSignInState(const std::string account_key, bool is_signed_in) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 AccountTracker::UpdateSignInState")); + StartTrackingAccount(account_key); AccountState& account = accounts_[account_key]; bool needs_gaia_id = account.ids.gaia.empty(); @@ -180,6 +199,12 @@ void AccountTracker::UpdateSignInState(const std::string account_key, } void AccountTracker::StartTrackingAccount(const std::string account_key) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 AccountTracker::StartTrackingAccount")); + if (!ContainsKey(accounts_, account_key)) { DVLOG(1) << "StartTracking " << account_key; AccountState account_state; @@ -211,16 +236,42 @@ void AccountTracker::StopTrackingAllAccounts() { } void AccountTracker::StartFetchingUserInfo(const std::string account_key) { - if (ContainsKey(user_info_requests_, account_key)) + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 AccountTracker::StartFetchingUserInfo")); + + if (ContainsKey(user_info_requests_, account_key)) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 + // is fixed. + tracked_objects::ScopedTracker tracking_profile1( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 AccountTracker::StartFetchingUserInfo 1")); + DeleteFetcher(user_info_requests_[account_key]); + } DVLOG(1) << "StartFetching " << account_key; + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile2( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 AccountTracker::StartFetchingUserInfo 2")); + AccountIdFetcher* fetcher = new AccountIdFetcher(identity_provider_->GetTokenService(), request_context_getter_.get(), this, account_key); user_info_requests_[account_key] = fetcher; + + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile3( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 AccountTracker::StartFetchingUserInfo 3")); + fetcher->Start(); } diff --git a/google_apis/gaia/identity_provider.cc b/google_apis/gaia/identity_provider.cc index 842891e..be698ff 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_tracker.h" #include "google_apis/gaia/identity_provider.h" IdentityProvider::Observer::~Observer() {} @@ -39,6 +40,12 @@ void IdentityProvider::RemoveObserver(Observer* observer) { } void IdentityProvider::OnRefreshTokenAvailable(const std::string& account_id) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 IdentityProvider::OnRefreshTokenAvailable")); + if (account_id != GetActiveAccountId()) return; FOR_EACH_OBSERVER(OAuth2TokenService::Observer, diff --git a/google_apis/gaia/oauth2_token_service.cc b/google_apis/gaia/oauth2_token_service.cc index b0c4aa4..34dfc1b 100644 --- a/google_apis/gaia/oauth2_token_service.cc +++ b/google_apis/gaia/oauth2_token_service.cc @@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" +#include "base/profiler/scoped_tracker.h" #include "base/rand_util.h" #include "base/stl_util.h" #include "base/time/time.h" @@ -214,6 +215,12 @@ OAuth2TokenService::Fetcher* OAuth2TokenService::Fetcher::CreateAndStart( scopes, waiting_request); + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 OAuth2TokenService::Fetcher::CreateAndStart")); + fetcher->Start(); return fetcher; } @@ -461,6 +468,12 @@ OAuth2TokenService::StartRequestForClientWithContext( Consumer* consumer) { DCHECK(CalledOnValidThread()); + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile1( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 OAuth2TokenService::StartRequestForClientWithContext 1")); + scoped_ptr<RequestImpl> request(new RequestImpl(account_id, consumer)); FOR_EACH_OBSERVER(DiagnosticsObserver, diagnostics_observer_list_, OnAccessTokenRequested(account_id, @@ -468,6 +481,12 @@ OAuth2TokenService::StartRequestForClientWithContext( scopes)); if (!RefreshTokenIsAvailable(account_id)) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 + // is fixed. + tracked_objects::ScopedTracker tracking_profile2( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 OAuth2TokenService::StartRequestForClientWithContext 2")); + GoogleServiceAuthError error(GoogleServiceAuthError::USER_NOT_SIGNED_UP); FOR_EACH_OBSERVER(DiagnosticsObserver, diagnostics_observer_list_, @@ -488,6 +507,12 @@ OAuth2TokenService::StartRequestForClientWithContext( account_id, scopes); if (HasCacheEntry(request_parameters)) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 + // is fixed. + tracked_objects::ScopedTracker tracking_profile3( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 OAuth2TokenService::StartRequestForClientWithContext 3")); + StartCacheLookupRequest(request.get(), request_parameters, consumer); } else { FetchOAuth2Token(request.get(), @@ -506,6 +531,12 @@ void OAuth2TokenService::FetchOAuth2Token(RequestImpl* request, const std::string& client_id, const std::string& client_secret, const ScopeSet& scopes) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 OAuth2TokenService::FetchOAuth2Token")); + // If there is already a pending fetcher for |scopes| and |account_id|, // simply register this |request| for those results rather than starting // a new fetcher. @@ -757,6 +788,12 @@ void OAuth2TokenService::CancelFetchers( void OAuth2TokenService::FireRefreshTokenAvailable( const std::string& account_id) { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 OAuth2TokenService::FireRefreshTokenAvailable")); + FOR_EACH_OBSERVER(Observer, observer_list_, OnRefreshTokenAvailable(account_id)); } @@ -768,6 +805,12 @@ void OAuth2TokenService::FireRefreshTokenRevoked( } void OAuth2TokenService::FireRefreshTokensLoaded() { + // TODO(robliao): Remove ScopedTracker below once https://crbug.com/422460 is + // fixed. + tracked_objects::ScopedTracker tracking_profile( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "422460 OAuth2TokenService::FireRefreshTokensLoaded")); + FOR_EACH_OBSERVER(Observer, observer_list_, OnRefreshTokensLoaded()); } |