Skip to content

Commit

Permalink
Remove tiny_storage and registory. They were mainly used in usage_stats.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 725108576
  • Loading branch information
taku910 authored and hiroyuki-komatsu committed Feb 10, 2025
1 parent 0a14384 commit 0252291
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 1,039 deletions.
2 changes: 0 additions & 2 deletions src/session/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ mozc_cc_library(
"//prediction:user_history_predictor",
"//protocol:commands_cc_proto",
"//protocol:config_cc_proto",
"//storage:registry",
"//testing:mozctest",
"@com_google_absl//absl/flags:flag",
],
Expand Down Expand Up @@ -491,7 +490,6 @@ mozc_cc_library(
"//protocol:commands_cc_proto",
"//protocol:config_cc_proto",
"//request:request_test_util",
"//storage:registry",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
Expand Down
2 changes: 0 additions & 2 deletions src/session/session_handler_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include "protocol/commands.pb.h"
#include "protocol/config.pb.h"
#include "session/session_handler.h"
#include "storage/registry.h"

ABSL_DECLARE_FLAG(int32_t, max_session_size);
ABSL_DECLARE_FLAG(int32_t, create_session_min_interval);
Expand Down Expand Up @@ -142,7 +141,6 @@ void SessionHandlerTestBase::ClearState() {

// Some destructors may save the state on storages. To clear the state, we
// explicitly call destructors before clearing storages.
storage::Registry::Clear();
FileUtil::UnlinkOrLogError(
ConfigFileStream::GetFileName("user://boundary.db"));
FileUtil::UnlinkOrLogError(
Expand Down
2 changes: 0 additions & 2 deletions src/session/session_handler_tool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
#include "protocol/config.pb.h"
#include "request/request_test_util.h"
#include "session/session_handler.h"
#include "storage/registry.h"

namespace mozc {
namespace session {
Expand Down Expand Up @@ -335,7 +334,6 @@ void SessionHandlerInterpreter::ClearState() {

// Some destructors may save the state on storages. To clear the state, we
// explicitly call destructors before clearing storages.
storage::Registry::Clear();
FileUtil::UnlinkOrLogError(
ConfigFileStream::GetFileName("user://boundary.db"));
FileUtil::UnlinkOrLogError(
Expand Down
77 changes: 3 additions & 74 deletions src/storage/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -132,79 +132,6 @@ mozc_cc_test(
],
)

mozc_cc_library(
name = "storage_interaface",
hdrs = ["storage_interface.h"],
deps = ["//base:port"],
)

mozc_cc_library(
name = "tiny_storage",
srcs = ["tiny_storage.cc"],
hdrs = ["tiny_storage.h"],
deps = [
":storage_interaface",
"//base:bits",
"//base:file_stream",
"//base:file_util",
"//base:mmap",
"//base:vlog",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
],
)

mozc_cc_test(
name = "tiny_storage_test",
size = "small",
srcs = ["tiny_storage_test.cc"],
deps = [
":storage_interaface",
":tiny_storage",
"//base/file:temp_dir",
"//testing:gunit_main",
"//testing:mozctest",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/strings",
],
)

mozc_cc_library(
name = "registry",
srcs = ["registry.cc"],
hdrs = ["registry.h"],
deps = [
":storage_interaface",
":tiny_storage",
"//base:bits",
"//base:file_util",
"//base:port",
"//base:singleton",
"//base:system_util",
"//base:vlog",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
],
)

mozc_cc_test(
name = "registry_test",
size = "small",
srcs = ["registry_test.cc"],
deps = [
":registry",
"//testing:gunit_main",
"//testing:mozctest",
],
)

mozc_cc_library(
name = "encrypted_string_storage",
srcs = ["encrypted_string_storage.cc"],
Expand All @@ -228,7 +155,9 @@ mozc_cc_test(
name = "encrypted_string_storage_test",
size = "small",
srcs = ["encrypted_string_storage_test.cc"],
tags = ["nowin"], # TODO(yuryu): depends on //base:encryptor
tags = [
"nowin",
], # TODO(yuryu): depends on //base:encryptor
deps = [
":encrypted_string_storage",
"//base:file_stream",
Expand Down
115 changes: 0 additions & 115 deletions src/storage/registry.cc

This file was deleted.

132 changes: 0 additions & 132 deletions src/storage/registry.h

This file was deleted.

Loading

0 comments on commit 0252291

Please sign in to comment.