author | Masayuki Nakano <masayuki@d-toybox.com> |
Tue, 19 Jun 2018 21:00:01 +0900 | |
changeset 424005 | cbbdabbed7e04b5ddcb65daa89b625b9ad3ae60b |
parent 424004 | 6c1bb0f3ff9807262d85034dac5194139160ee1b |
child 424006 | 1d5d0381e51dcf6485f14d00a8c881d7f72def49 |
push id | 34197 |
push user | csabou@mozilla.com |
push date | Thu, 28 Jun 2018 09:44:02 +0000 |
treeherder | mozilla-central@db455160668d [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jimm, m_kato |
bugs | 1215818 |
milestone | 63.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
toolkit/components/telemetry/Scalars.yaml | file | annotate | diff | comparison | revisions | |
widget/windows/TSFTextStore.cpp | file | annotate | diff | comparison | revisions |
--- a/toolkit/components/telemetry/Scalars.yaml +++ b/toolkit/components/telemetry/Scalars.yaml @@ -1727,16 +1727,35 @@ browser.errors: expires: "64" kind: uint notification_emails: - nightly-js-errors@mozilla.com - mkelly@mozilla.com record_in_processes: - 'main' +widget: + ime_name_on_windows: + bug_numbers: + - 1215818 + description: > + Locale ID and name of IME which was selected by users on Windows. This + does NOT collect legacy IMM-IME names since we cannot get readable names + and we do not support IMM-IME so aggressively because IME vendors + should've already released TIP for TSF for supporting Windows 8 or later + completely. + keyed: true + expires: never + kind: boolean + notification_emails: + - mnakano@mozilla.com + release_channel_collection: opt-out + record_in_processes: + - 'main' + # The following section contains memory reporter counters. memoryreporter: max_ghost_windows: bug_numbers: - 1454724 description: > The maximum number of leaked ghost windows seen. expires: "66"
--- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -13,16 +13,17 @@ #include "IMMHandler.h" #include "KeyboardLayout.h" #include "WinIMEHandler.h" #include "WinUtils.h" #include "mozilla/AutoRestore.h" #include "mozilla/Logging.h" #include "mozilla/Preferences.h" +#include "mozilla/Telemetry.h" #include "mozilla/TextEventDispatcher.h" #include "mozilla/TextEvents.h" #include "mozilla/WindowsVersion.h" #include "nsIXULRuntime.h" #include "nsWindow.h" #include "nsPrintfCString.h" namespace mozilla { @@ -1557,16 +1558,41 @@ TSFStaticSink::OnActivated(DWORD dwProfi (dwProfileType == TF_PROFILETYPE_KEYBOARDLAYOUT || catid == GUID_TFCAT_TIP_KEYBOARD)) { mOnActivatedCalled = true; mActiveTIPGUID = guidProfile; mLangID = langid; mIsIMM_IME = IsIMM_IME(hkl); GetTIPDescription(rclsid, mLangID, guidProfile, mActiveTIPKeyboardDescription); + if (mActiveTIPGUID != GUID_NULL) { + // key should be "LocaleID|Description". Although GUID of the + // profile is unique key since description may be localized for system + // language, unfortunately, it's too long to record as key with its + // description. Therefore, we should record only the description with + // LocaleID because Microsoft IME may not include language information. + // 72 is kMaximumKeyStringLength in TelemetryScalar.cpp + nsAutoString key; + key.AppendPrintf("0x%04X|", mLangID & 0xFFFF); + nsAutoString description(mActiveTIPKeyboardDescription); + static const uint32_t kMaxDescriptionLength = 72 - key.Length(); + if (description.Length() > kMaxDescriptionLength) { + if (NS_IS_LOW_SURROGATE(description[kMaxDescriptionLength - 1]) && + NS_IS_HIGH_SURROGATE(description[kMaxDescriptionLength - 2])) { + description.Truncate(kMaxDescriptionLength - 2); + } else { + description.Truncate(kMaxDescriptionLength - 1); + } + // U+2026 is "..." + description.Append(char16_t(0x2026)); + } + key.Append(description); + Telemetry::ScalarSet(Telemetry::ScalarID::WIDGET_IME_NAME_ON_WINDOWS, + key, true); + } // Notify IMEHandler of changing active keyboard layout. IMEHandler::OnKeyboardLayoutChanged(); } MOZ_LOG(sTextStoreLog, LogLevel::Info, ("0x%p TSFStaticSink::OnActivated(dwProfileType=%s (0x%08X), " "langid=0x%08X, rclsid=%s, catid=%s, guidProfile=%s, hkl=0x%08X, " "dwFlags=0x%08X (TF_IPSINK_FLAG_ACTIVE: %s)), mIsIMM_IME=%s, " "mActiveTIPDescription=\"%s\"",