Commit 1850ee0b authored by vadimt's avatar vadimt Committed by Commit bot

Mechanical change that adds instrumentation required to locate the source of...

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=422460
TBR=isherman@chromium.org, caitkp@chromium.org

Review URL: https://codereview.chromium.org/647123002

Cr-Commit-Position: refs/heads/master@{#299198}
parent 76a748ae
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/profiler/scoped_profile.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/os_crypt/ie7_password_win.h" #include "components/os_crypt/ie7_password_win.h"
...@@ -142,6 +143,11 @@ std::vector<PasswordForm*> PasswordStoreWin::DBHandler::GetIE7Results( ...@@ -142,6 +143,11 @@ std::vector<PasswordForm*> PasswordStoreWin::DBHandler::GetIE7Results(
void PasswordStoreWin::DBHandler::OnWebDataServiceRequestDone( void PasswordStoreWin::DBHandler::OnWebDataServiceRequestDone(
PasswordWebDataService::Handle handle, PasswordWebDataService::Handle handle,
const WDTypedResult* result) { const WDTypedResult* result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422460 PasswordStoreWin::DBHandler::OnWebDataServiceRequestDone"));
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
PendingRequestMap::iterator i = pending_requests_.find(handle); PendingRequestMap::iterator i = pending_requests_.find(handle);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <vector> #include <vector>
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "base/profiler/scoped_profile.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_client.h" #include "components/autofill/core/browser/autofill_client.h"
...@@ -53,6 +54,11 @@ AutocompleteHistoryManager::~AutocompleteHistoryManager() { ...@@ -53,6 +54,11 @@ AutocompleteHistoryManager::~AutocompleteHistoryManager() {
void AutocompleteHistoryManager::OnWebDataServiceRequestDone( void AutocompleteHistoryManager::OnWebDataServiceRequestDone(
WebDataServiceBase::Handle h, WebDataServiceBase::Handle h,
const WDTypedResult* result) { const WDTypedResult* result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422460 AutocompleteHistoryManager::OnWebDataServiceRequestDone"));
DCHECK(pending_query_handle_); DCHECK(pending_query_handle_);
pending_query_handle_ = 0; pending_query_handle_ = 0;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "base/profiler/scoped_profile.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
...@@ -188,6 +189,11 @@ PersonalDataManager::~PersonalDataManager() { ...@@ -188,6 +189,11 @@ PersonalDataManager::~PersonalDataManager() {
void PersonalDataManager::OnWebDataServiceRequestDone( void PersonalDataManager::OnWebDataServiceRequestDone(
WebDataServiceBase::Handle h, WebDataServiceBase::Handle h,
const WDTypedResult* result) { const WDTypedResult* result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422460 PersonalDataManager::OnWebDataServiceRequestDone"));
DCHECK(pending_profiles_query_ || pending_creditcards_query_); DCHECK(pending_profiles_query_ || pending_creditcards_query_);
if (!result) { if (!result) {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/memory/scoped_vector.h" #include "base/memory/scoped_vector.h"
#include "base/metrics/histogram.h" #include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h" #include "base/prefs/pref_service.h"
#include "base/profiler/scoped_profile.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
...@@ -825,6 +826,11 @@ scoped_ptr<TemplateURLService::Subscription> ...@@ -825,6 +826,11 @@ scoped_ptr<TemplateURLService::Subscription>
void TemplateURLService::OnWebDataServiceRequestDone( void TemplateURLService::OnWebDataServiceRequestDone(
KeywordWebDataService::Handle h, KeywordWebDataService::Handle h,
const WDTypedResult* result) { const WDTypedResult* result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422460 TemplateURLService::OnWebDataServiceRequestDone"));
// Reset the load_handle so that we don't try and cancel the load in // Reset the load_handle so that we don't try and cancel the load in
// the destructor. // the destructor.
load_handle_ = 0; load_handle_ = 0;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "components/signin/core/browser/mutable_profile_oauth2_token_service.h" #include "components/signin/core/browser/mutable_profile_oauth2_token_service.h"
#include "base/profiler/scoped_profile.h"
#include "components/signin/core/browser/signin_client.h" #include "components/signin/core/browser/signin_client.h"
#include "components/signin/core/browser/signin_metrics.h" #include "components/signin/core/browser/signin_metrics.h"
#include "components/signin/core/browser/webdata/token_web_data.h" #include "components/signin/core/browser/webdata/token_web_data.h"
...@@ -187,6 +188,11 @@ void MutableProfileOAuth2TokenService::LoadCredentials( ...@@ -187,6 +188,11 @@ void MutableProfileOAuth2TokenService::LoadCredentials(
void MutableProfileOAuth2TokenService::OnWebDataServiceRequestDone( void MutableProfileOAuth2TokenService::OnWebDataServiceRequestDone(
WebDataServiceBase::Handle handle, WebDataServiceBase::Handle handle,
const WDTypedResult* result) { const WDTypedResult* result) {
// TODO(vadimt): Remove ScopedProfile below once crbug.com/422460 is fixed.
tracked_objects::ScopedProfile tracking_profile(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"422460 MutableProfileOAuth2Token...::OnWebDataServiceRequestDone"));
DCHECK_EQ(web_data_service_request_, handle); DCHECK_EQ(web_data_service_request_, handle);
web_data_service_request_ = 0; web_data_service_request_ = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment