summaryrefslogtreecommitdiffstats
path: root/components/translate
diff options
context:
space:
mode:
authorvadimt <vadimt@chromium.org>2014-10-22 17:39:10 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-23 00:39:23 +0000
commit77d1e3890147ab453d580623c9bbae511957e34d (patch)
tree3ba60a1d1a2d623e1cfff7cc8e812220f2c3ad37 /components/translate
parent038e3479a4d51c603b3aff7973a0d62233b22749 (diff)
downloadchromium_src-77d1e3890147ab453d580623c9bbae511957e34d.zip
chromium_src-77d1e3890147ab453d580623c9bbae511957e34d.tar.gz
chromium_src-77d1e3890147ab453d580623c9bbae511957e34d.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. They've helped to find and fix janky code. 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=422577 TBR=toyoshim@chromium.org Review URL: https://codereview.chromium.org/670243003 Cr-Commit-Position: refs/heads/master@{#300812}
Diffstat (limited to 'components/translate')
-rw-r--r--components/translate/core/browser/translate_language_list.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/components/translate/core/browser/translate_language_list.cc b/components/translate/core/browser/translate_language_list.cc
index 6a9b8c2..5db1a1c 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;