- Update the comment.
Background:
1. The condition was added for enrich partial feature (cl/449889011)
2. Enrich partial was launched and removed the condition for enrich partial (cl/496594650)
- Here, the check for TYPING_CORRECTION should be removed.
#codehealth
PiperOrigin-RevId: 513677045
- Looks like they're not inherited, so we can save some memory by making them non-virtual.
- Entry getters are now constexpr
- Table is trivially constructive
- Merged ResetEntrySet into the destructor
- Put entries_ outside of a unique_ptr. EntryTrie uses its own hash map.
PiperOrigin-RevId: 513528653
On 64-bit Windows, HWND is 64-bit long, but only 32 bits are used. Mozc's IPC messages use 32-bit window handles. reinterpret_cast between objects with different sizes is not allowed in C++.
PiperOrigin-RevId: 513383634
As we discussed in cl/513072642, we're moving special key related functions to special_key.cc.
- Add a new class, SpecialKeyMap
- Implementation of Table::ParseSpecialKey is now in SpecialKeyMap::Parse
- Move FindBlock, ParseBlock, and DeleteSpecialKey to special_key.cc
- Renamed DeleteSpecialKey as DeleteSpecialKeys
- Use std::optional and return by value
- Instead of using a cursor, update the input string with a substring
PiperOrigin-RevId: 513378557
These macro return copts and features values when building for Windows.
This CL also moves the mozc_win32_lib macro to the separate internal.bzl as it's not intended to be used outside of the directory.
PiperOrigin-RevId: 513368430
- Add a default statement to non-exhaustive switch statements
- Reorder constructor initialization list
- Include what you use
PiperOrigin-RevId: 513130389
Changed the size to sizeof(LOGFONTW). It previously passed sizeof(log_font), but it's a pointer. Use the underlying type instead.
PiperOrigin-RevId: 513126095
The source file has a pragma comment for msvc, but it doesn't work for other compilers. All targets that depend on this winmain library will have the linkopt.
PiperOrigin-RevId: 513093371
In 64-bit clang, Json::Value has both 32-bit and 64-bit constructors and lead to ambiguous conversion errors. Explicitly cast the LONG values to avoid the errors.
PiperOrigin-RevId: 513092810
CharChunk::AddInputInternal modified the input string with string::erase, but the time complexity of string::erase is O(n) (n is the remaining string length). The new implementation instead returns a pair<bool, string_view>, which has the loop indicator and remainder of the input. string_view::substr has constant complexity.
AddInput can also use the same rewrite, but it's for another CL as it's a public method.
Also moved Table::TrimLeadingSpecialKey to internal/special_key.{h,cc} as it's only used by table_test and char_chunk.
PiperOrigin-RevId: 513072642
FrontChar takea a string_view and returns a pair of string_views
- first: the first character in the input
- second: the rest of the input
Util::SplitFirstChar32 will be refactored to use this method later.
PiperOrigin-RevId: 513054214
- Move BlockBitmap to the internal namespace and include the declaration in the header file. The declaration is now in the header file to make ExistenceFilter trivially destructible.
- ExistenceFilter is now trivially destructible.
- ExistenceFilter::Size, BlockBitmap::Get, BlockBitmap::Set, and BitsToWords are now constexpr
PiperOrigin-RevId: 513053962
Also:
- Migrate `std::to_string` to `absl::StrCat`.
- Removed `IsRunning` part of assertion since it really doesn't add any value
PiperOrigin-RevId: 512894919
- Merge InternalState into the main class as it's small and no need to new it.
- Use Stopwatch::GetElapsed instead of deprecated GetElapsedMilliseconds
- Make IsVisible constexpr.
- IndicatorVisibilityTracker is now trivially constructible and destructible.
#codehealth
PiperOrigin-RevId: 512789396
* follow-up to cl/512471568
* Rollback the change to the rule of "googletest".
* Use mozctest_test.cc as a test path.
#codehealth
PiperOrigin-RevId: 512636268
This is used by many so it'g going to be the first function to have this new place. There were two OneCharLen definitions in util.cc and japanese_util.cc, so both of them were replaced by the new definition.
#codehealth
PiperOrigin-RevId: 512553462
This new library recursively deletes all files under a directory. It supports Windows and Linux/MacOS with IShellItem and fts(3) respectively. It doesn't support iOS and is intended for tools and tests use.
PiperOrigin-RevId: 512553124
These are reimplementations of the same functions in Util, but faster.
- Take std::wstring_view instead of const std::wstring& (absl doesn't have wstring_view).
- No extra memory copy. The old implementation used a temporary buffer before returning as std::string/wstring.
- Return by value. Most of the existing callers don't reuse buffers anyways.
PiperOrigin-RevId: 512519791
release is the name used by other smart pointers, so we're aligning with them.
ScopedHandle is now movable so you can use std::move like std::unique_ptr.
#codehealth
PiperOrigin-RevId: 512507269
- Use TempDirectory to get a path to a temp directory.
- access(2) checks privileges with real user, not effective user. So, instead of checking it every time, added a unit test for MozcTestTest.
- googletest now sets both test_srcdir and test_tmpdir correctly on Windows.
PiperOrigin-RevId: 512471568
TempDirectory::Default tries several common places and returns the first available directory as a TempDirectory instance. It can be used to create unique temp directories and files. These created objects will be deleted when they go out of scope.
TempDirectory::Default tries TEST_TMPDIR first, then the following places:
- Win32: GetTempPath2 or GetTempPath
- POSIX: TMPDIR, /tmp, (/sdcard for Android), current directory
This is the first library in base/file. file_util will be split and reorganized into this directory.
PiperOrigin-RevId: 512467701
Define and use a struct type to return both display_mode and input_mode at once. The default value when a rule is not found is NO_CHANGE, so we can simplify the conditionals.
#codehealth
PiperOrigin-RevId: 512467262