Skip to content

Commit

Permalink
Run Clang's Include Cleaner on //server and //session.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 634993847
  • Loading branch information
tomokinat authored and hiroyuki-komatsu committed May 18, 2024
1 parent 0022f77 commit 08ea31b
Show file tree
Hide file tree
Showing 29 changed files with 75 additions and 63 deletions.
5 changes: 4 additions & 1 deletion src/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ mozc_cc_library(
deps = [
"//base:crash_report_handler",
"//base:init_mozc",
"//base:logging",
"//base:process_mutex",
"//base:run_level",
"//base:singleton",
Expand All @@ -89,6 +88,8 @@ mozc_cc_library(
"//session:session_server",
"@com_google_absl//absl/base:config",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
] + mozc_select(
windows = ["//base/win32:winmain"],
),
Expand All @@ -107,6 +108,8 @@ mozc_cc_binary(
"//session:session_handler",
"//session:session_usage_observer",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
],
)

Expand Down
30 changes: 16 additions & 14 deletions src/server/mozc_rpc_server_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,16 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <cstdint>
#ifdef _WIN32
#include <windows.h>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
using ssize_t = SSIZE_T;
#else // _WIN32
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
#endif // _WIN32

#include <cstddef>
#include <cstdint>
#include <cstring>
#include <memory>
#include <string>
#include <vector>

#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "base/init_mozc.h"
#include "base/singleton.h"
#include "base/system_util.h"
Expand All @@ -57,6 +46,19 @@ using ssize_t = SSIZE_T;
#include "session/session_handler.h"
#include "session/session_usage_observer.h"

#ifdef _WIN32
#include <windows.h>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
using ssize_t = SSIZE_T;
#else // _WIN32
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
#endif // _WIN32

ABSL_FLAG(std::string, host, "localhost", "server host name");
ABSL_FLAG(bool, server, true, "server mode");
ABSL_FLAG(bool, client, false, "client mode");
Expand Down
12 changes: 6 additions & 6 deletions src/server/mozc_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,16 @@

#include "server/mozc_server.h"

#ifdef _WIN32
#include <windows.h>
#endif // _WIN32

#include <cstddef>
#include <memory>
#include <string>

#include "absl/base/config.h"
#include "absl/flags/declare.h"
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "base/crash_report_handler.h"
#include "base/init_mozc.h"
#include "base/logging.h"
#include "base/process_mutex.h"
#include "base/run_level.h"
#include "base/singleton.h"
Expand All @@ -51,6 +47,10 @@
#include "config/stats_config_util.h"
#include "session/session_server.h"

#ifdef _WIN32
#include <windows.h>
#endif // _WIN32

ABSL_DECLARE_FLAG(bool, restricted); // in SessionHandler

namespace {
Expand Down
26 changes: 14 additions & 12 deletions src/session/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ mozc_cc_library(
"//transliteration",
"//usage_stats",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
],
Expand All @@ -182,7 +183,6 @@ mozc_cc_test(
shard_count = 8,
deps = [
":session",
"//base:logging",
"//base:vlog",
"//base/strings:assign",
"//base/strings:unicode",
Expand Down Expand Up @@ -211,6 +211,7 @@ mozc_cc_test(
"//transliteration",
"//usage_stats",
"//usage_stats:usage_stats_testing_util",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
Expand All @@ -229,7 +230,6 @@ mozc_cc_test(
deps = [
":session",
":session_handler",
"//base:logging",
"//composer:key_parser",
"//composer:table",
"//config:config_handler",
Expand All @@ -245,6 +245,7 @@ mozc_cc_test(
"//testing:gunit_main",
"//testing:mozctest",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log:check",
],
)

Expand Down Expand Up @@ -283,7 +284,6 @@ mozc_cc_library(
":session_observer_handler",
":session_observer_interface",
"//base:clock",
"//base:logging",
"//base:singleton",
"//base:stopwatch",
"//base:util",
Expand Down Expand Up @@ -407,12 +407,12 @@ mozc_cc_library(
":session_handler",
":session_handler_interface",
":session_usage_observer",
"//base:logging",
"//base:vlog",
"//engine:engine_factory",
"//ipc",
"//ipc:named_event",
"//protocol:commands_cc_proto",
"@com_google_absl//absl/log",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
],
Expand Down Expand Up @@ -451,12 +451,13 @@ mozc_cc_library(
deps = [
"//base:clock",
"//base:cpu_stats",
"//base:logging",
"//base:system_util",
"//base:thread",
"//base:vlog",
"//client",
"//client:client_interface",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
"@com_google_absl//absl/types:span",
Expand All @@ -474,10 +475,10 @@ mozc_cc_test(
deps = [
":session_watch_dog",
"//base:cpu_stats",
"//base:logging",
"//client:client_mock",
"//testing:gunit_main",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
Expand All @@ -491,7 +492,6 @@ mozc_cc_library(
deps = [
":session_observer_interface",
"//base:clock",
"//base:logging",
"//base:vlog",
"//config:stats_config_util",
"//protocol:candidates_cc_proto",
Expand All @@ -500,6 +500,8 @@ mozc_cc_library(
"//usage_stats",
"//usage_stats:usage_stats_cc_proto",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
],
Expand All @@ -514,7 +516,6 @@ mozc_cc_test(
":session_usage_observer",
"//base:clock",
"//base:clock_mock",
"//base:logging",
"//config:stats_config_util",
"//config:stats_config_util_mock",
"//protocol:commands_cc_proto",
Expand All @@ -523,6 +524,7 @@ mozc_cc_test(
"//usage_stats",
"//usage_stats:usage_stats_cc_proto",
"//usage_stats:usage_stats_testing_util",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/time",
],
)
Expand All @@ -533,14 +535,14 @@ mozc_cc_library(
hdrs = ["key_info_util.h"],
deps = [
"//base:config_file_stream",
"//base:logging",
"//base:util",
"//composer:key_event_util",
"//composer:key_parser",
"//config:config_handler",
"//protocol:commands_cc_proto",
"//protocol:config_cc_proto",
"//session/internal:keymap",
"@com_google_absl//absl/log",
"@com_google_absl//absl/strings",
],
)
Expand All @@ -565,11 +567,11 @@ mozc_cc_library(
srcs = ["session_usage_stats_util.cc"],
hdrs = ["session_usage_stats_util.h"],
deps = [
"//base:logging",
"//base:util",
"//protocol:commands_cc_proto",
"//usage_stats",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/strings",
],
)
Expand Down Expand Up @@ -616,13 +618,13 @@ mozc_cc_library(
hdrs = ["random_keyevents_generator.h"],
deps = [
"//base:japanese_util",
"//base:logging",
"//base:util",
"//base:vlog",
"//composer:key_parser",
"//protocol:commands_cc_proto",
"//session/internal:keymap",
"@com_google_absl//absl/base",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/random",
"@com_google_absl//absl/random:distributions",
"@com_google_absl//absl/strings",
Expand Down Expand Up @@ -660,6 +662,7 @@ mozc_cc_test(
"//testing:gunit_main",
"//testing:mozctest",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log",
],
)

Expand Down Expand Up @@ -751,7 +754,6 @@ mozc_cc_test(
":session_handler_tool",
"//base:file_stream",
"//base:file_util",
"//base:logging",
"//engine:engine_interface",
"//engine:mock_data_engine_factory",
"//prediction:user_history_predictor",
Expand Down
13 changes: 7 additions & 6 deletions src/session/internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ mozc_cc_library(
deps = [
":key_event_transformer",
":keymap",
"//base:logging",
"//composer",
"//config:config_handler",
"//protocol:commands_cc_proto",
"//protocol:config_cc_proto",
"//session:session_converter_interface",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/time",
],
)
Expand All @@ -62,9 +62,8 @@ mozc_cc_library(
deps = [
"//base:config_file_stream",
"//base:file_stream",
"//base:logging",
"//base:util",
"//base/protobuf",
"//base/protobuf:repeated_field",
"//composer:key_event_util",
"//composer:key_parser",
"//config:config_handler",
Expand All @@ -73,6 +72,8 @@ mozc_cc_library(
"//testing:friend_test",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/strings",
],
)
Expand All @@ -83,13 +84,13 @@ mozc_cc_library(
hdrs = ["key_event_transformer.h"],
deps = [
"//base:japanese_util",
"//base:logging",
"//base:singleton",
"//composer:key_event_util",
"//config:config_handler",
"//protocol:commands_cc_proto",
"//protocol:config_cc_proto",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
],
)

Expand All @@ -99,8 +100,8 @@ mozc_cc_library(
hdrs = ["candidate_list.h"],
deps = [
"//base:hash",
"//base:logging",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
],
Expand Down
3 changes: 2 additions & 1 deletion src/session/internal/candidate_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
#include "session/internal/candidate_list.h"

#include <cstddef>
#include <cstdint>
#include <memory>
#include <vector>

#include "absl/log/check.h"
#include "absl/strings/string_view.h"
#include "base/hash.h"
#include "base/logging.h"

namespace mozc {
namespace session {
Expand Down
2 changes: 1 addition & 1 deletion src/session/internal/candidate_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
#include <vector>

#include "absl/container/flat_hash_map.h"
#include "absl/log/check.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "base/logging.h"

namespace mozc {
namespace session {
Expand Down
2 changes: 1 addition & 1 deletion src/session/internal/ime_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "session/internal/ime_context.h"

#include "base/logging.h"
#include "absl/log/check.h"
#include "composer/composer.h"
#include "protocol/commands.pb.h"
#include "session/internal/keymap.h"
Expand Down
3 changes: 2 additions & 1 deletion src/session/internal/key_event_transformer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
#include <cstdint>
#include <string>

#include "absl/log/check.h"
#include "absl/log/log.h"
#include "base/japanese_util.h"
#include "base/logging.h"
#include "composer/key_event_util.h"
#include "config/config_handler.h"
#include "protocol/commands.pb.h"
Expand Down
Loading

0 comments on commit 08ea31b

Please sign in to comment.