This CL partially reverts cl/515199465 and e7f823f23f so that fields in `RendererLauncher` can be explicitly initialized. At least Visual C++ 2022 debug build does require these initializations.
Hopefully having explicit initial values in source code also helps future readers anyway.
Fixesgoogle/mozc#702
PiperOrigin-RevId: 519476998
If the build machine has multiple CPU cores, `build_mozc.py runtests` executs tests in parallel mode by default. However the parallel mode makes it difficult to see what tests are actually failing in continuous test environment. The worst case scenario is that `build_mozc.py runtests` fails to show actual failures and dashboard continues to look normal.
PiperOrigin-RevId: 519465778
Currently there is a chance that Mozc GYP build fails on Windows because some of GYP python files do not explicitly specify file encoding when loading source files thus python uses `locale.getpreferredencoding()`, which can be affected by `"Language for non-Unicode programs"` in the OS global settings. Note that Mozc's own python files are supposed to be explicitly specifying input file encoding thus this is not the case any more.
In order to mitigate such nondeterministic behaviors at the GYP level, this CL sets `PYTHONUTF8` environment variable for Python 3.7 so chat Python UTF-8 mode (PEP 540) can be explicitly enabled for GYP.
Note that Python is expected to enable UTF-8 mode by default from Python 3.15 (PEP 686). Hopefully opting in that new behavior a bit earlier would make our lives easier. Once Windows build switch to Bazel, this hack should no longer be necessary anyway.
- PEP 540: https://peps.python.org/pep-0540/
- PEP 686: https://peps.python.org/pep-0686/
PiperOrigin-RevId: 519166596
In this LSC, we replace C++ protobuf DebugStrings with implicit AbslStringify conversions or absl::StrCat (go/totw/215). This makes debug information incompatible with TextFormat parsers (go/explicit-debug-string).
PiperOrigin-RevId: 518959344
Now that IMMM32 Mozc got removed, we can start deprecating IMM32-only stuff from renderer.
As the first step, this CL clarifies what are used only for IMM32 in `renderer_command.proto` with `[deprecated = true]`.
PiperOrigin-RevId: 518600795
* Without this change, candidates are filtered if another candidate has the same key and value.
* With this change, candidates are filtered only if another candidate has the same key, value, lid, and rid.
* This improves word ranking and candidate rewriting.
* Redundant candidates will be deduplicated in another layer.
* https://github.com/google/mozc/issues/689
#typingquality
PiperOrigin-RevId: 518537368
I found some negative results without this change:
Key: Top result value
ああ: 吁
あれ: 荒
あの: 穴
どこ: 床
ほご: 夸
Costs for single kanji prediction entries were decided based on other single kanji entries.
When there is no single kanji entries from other sources (UNIGRAM, REALTIME, etc), the offset cost were too small and relatively minor single kanji entries can be ranked high.
PiperOrigin-RevId: 518503396
* Added the deduplication feature to GetRank.
+ GetRank skips counting candidates, if the same values have been already checked.
+ This deduplication is also performed in production in another layer.
#codehealth
PiperOrigin-RevId: 518482618
This CL removes the following unused methods from `win32/base/uninstall_helper.cc`.
- `utow`
- `GetPreloadLayoutsMain`
- `BroadcastNewTIPOnVista`
- `EnableAndSetDefaultIfLayoutIsTIP`
#codehealth
PiperOrigin-RevId: 518055408
The change introduces sorting of list values of new rule attributes:
* test_data
* test_deps
* test_srcs
* test_tags
* private_deps
The values of the attributes mentioned above as well as all other attributes
that required sorting before (such as `srcs`, `deps`, `data`, etc) will now
also be sorted if the values are not single lists but concatenations of lists
and/or select statements.
More information: go/lsc-sort-labels
Tested:
TAP train for global presubmit queue
PiperOrigin-RevId: 517918293
* https://github.com/google/mozc/issues/689
* This does not solve the issue yet, because another entry of 一本 with different POS IDs is prioritized.
#typingquality
PiperOrigin-RevId: 517307936
With my previous CL the following classes are no longer used anywhere. Let's remove them for better code health.
- `AccessibleObject`
- `AccessibleObjectInfo`
- `BrowserInfo`
- `FocusHierarchyObserver`
#codehealth
PiperOrigin-RevId: 516844278
- Add thread annotations.
- Based on the comment "// |renderer_status_| is also protected by mutex.", mark it as `ABSL_GUARDED_BY` too
- Fix concurrency issues discovered by the added thread annotations.
- Use `enum class` instead of `enum`.
- Use `std::optional<T>` instead of `std::unique_ptr<T>` since the usage was just for nullability.
- Migrate to `mozc::Thread2`.
- include-what-you-use.
PiperOrigin-RevId: 516766669
As the first step towards deprecating `FocusHierarchyObserver`, this CL completely removes the dependency on it and `BrowserInfo` from files under `win32/tip/`.
Note that there must be no user-visible impact as the feature has been disabled since cl/102450708.
#codehealth
PiperOrigin-RevId: 516680258
We no longer need to consider the scenario for Windows XP/Vista/7 where IMM32 Mozc is installed on the machine. This means that we can safely simplify `UninstallHelper` class.
This CL removes such a legacy handling code for Windows 7.
This CL also removes `UninstallHelperTest::BasicCaseForVista()` as it is not a supported scenario any more.
#codehealth
PiperOrigin-RevId: 516672000
This method has been used to clean up any user-defined hotkey associated with IMM32 Mozc, which should no longer exist. Not calling this method should have no user impact.
#codehealth
PiperOrigin-RevId: 516432892
For some reasons `UninstallHelperTest::BasicCaseForWin8()` has been testing an unusual scenario where both IMM32 Mozc and TSF Mozc are installed at the same time.
This CL updates the test scenario for the real scenario.
PiperOrigin-RevId: 516429432
This is a logical rollback of changelist 39183361.
#### Reason for rollback
`MigrationUtil::DisableLegacyMozcForCurrentUserOnWin8()` was added more than 10 years ago as a quick workaround for users who upgraded from Windows 7 or prior OSes. Let's roll it back as we no longer support such upgrading scenario.
#### Original change description
Add a quick workaround to unregister IMM32 Mozc on Windows 8.
---
PiperOrigin-RevId: 516419611
Just to be consistent with recent WIX rule changes, with this CL all Mozc binaries start requring Windows 8 and later.
See cl/114053403 for the previous version bump.
Note that we'll most likely start requiring Windows 10 and later soon.
PiperOrigin-RevId: 516348145
PlatformString is an alias to std::basic_string, and PlatformStringView is a null-terminated platform-native string view. These classes aim to address a few pain points:
- absl::string_view doesn't guarantee null-termination and cannot be used for C-style APIs.
- Sometimes multiple conversions happen when calling APIs on Windows.
- consolidate platform conditionals into one build rule
<path/to/mozc>/base/file_stream.cc has ToPlatformString and this is a more complete version of that implementation.
PlatformStringView implements most of the C++17 string_view member functions, but lacks some operations like find, find_first_of, etc because the focus of the class is integration with C APIs. We can add them in the future if deemed necessary.
PiperOrigin-RevId: 516336863
InputMultiFile takes a string_view, so instead of passing a c_str, pass it directly.
Remove the explicit ifs_.reset call in the destructor because the unique_ptr destructor handles it.
PiperOrigin-RevId: 516073040
STL contaieners don't use them if they're not noexcept. std::string's move constructor and swap are noexcept, so we can mark them noexcept.
PiperOrigin-RevId: 516070982