Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: components/translate/core/browser/translate_language_list.cc

Issue 670243003: Adding instrumentation to locate the source of jankiness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding one more instrumentation. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/translate/core/browser/translate_language_list.cc
diff --git a/components/translate/core/browser/translate_language_list.cc b/components/translate/core/browser/translate_language_list.cc
index 6a9b8c2535eafeb08b0223ece23311f99a4ff813..5db1a1c701794980f5bbc5af7051877553255b37 100644
--- a/components/translate/core/browser/translate_language_list.cc
+++ b/components/translate/core/browser/translate_language_list.cc
@@ -256,12 +256,22 @@ void TranslateLanguageList::OnLanguageListFetchComplete(
}
void TranslateLanguageList::NotifyEvent(int line, const std::string& message) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422577 TranslateLanguageList::NotifyEvent"));
+
TranslateEventDetails details(__FILE__, line, message);
callback_list_.Notify(details);
}
void TranslateLanguageList::SetSupportedLanguages(
const std::string& language_list) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed.
+ tracked_objects::ScopedProfile tracking_profile1(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422577 TranslateLanguageList::SetSupportedLanguages 1"));
+
// The format is:
// sl({
// "sl": {"XX": "LanguageName", ...},
@@ -284,8 +294,20 @@ void TranslateLanguageList::SetSupportedLanguages(
std::string languages_json = language_list.substr(
kLanguageListCallbackNameLength,
language_list.size() - kLanguageListCallbackNameLength - 1);
+
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed.
+ tracked_objects::ScopedProfile tracking_profile2(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422577 TranslateLanguageList::SetSupportedLanguages 2"));
+
scoped_ptr<base::Value> json_value(
base::JSONReader::Read(languages_json, base::JSON_ALLOW_TRAILING_COMMAS));
+
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/422577 is fixed.
+ tracked_objects::ScopedProfile tracking_profile3(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "422577 TranslateLanguageList::SetSupportedLanguages 3"));
+
if (json_value == NULL || !json_value->IsType(base::Value::TYPE_DICTIONARY)) {
NOTREACHED();
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698