summaryrefslogtreecommitdiff
path: root/app-i18n/mozc
diff options
context:
space:
mode:
Diffstat (limited to 'app-i18n/mozc')
-rw-r--r--app-i18n/mozc/Manifest5
-rw-r--r--app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch1039
-rw-r--r--app-i18n/mozc/mozc-2.23.2815.102.ebuild1
-rw-r--r--app-i18n/mozc/mozc-9999.ebuild1
4 files changed, 1044 insertions, 2 deletions
diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest
index 10b542a1361b..f73abd9c958f 100644
--- a/app-i18n/mozc/Manifest
+++ b/app-i18n/mozc/Manifest
@@ -2,10 +2,11 @@ AUX 50mozc-gentoo.el 121 BLAKE2B 0cad49e4a5a04d1cbdcd063cfd5a06c14bf4bab47890bbc
AUX mozc-2.20.2673.102-tests_build.patch 1037 BLAKE2B 8f3c0b3361371a994957a89f5b86020902262de65aef75f82e58fcfcea211b8a8d3c8418898781ac1de2a2c9bdc73ffc4cf68102122a22691d9592d5a02e6c62 SHA512 d99ee7edbb406e123b26ec186933608b42d36193b7bfe67232810c0fbd7a92bd8cfff26dc45eae4f020e82e9a8370cf2033c750250455585b6b3d88cc8c973ef
AUX mozc-2.20.2673.102-tests_skipping.patch 2086 BLAKE2B a104d6a83b02b49e1208be1b39699b90ad419d8befa29ed0366f7cbc454fe9ce27361f21897a5c74dadfc2d9eb31a30d7237e20db8c1fb205b8e71b40f4a0e57 SHA512 4a2e5a35c5e65ebeb737f656d6efb313c660c2c7cf62abd5d9295fd16e2dffde21d069cd74fd0cfd2454cd7f7c9d136dfbadbf79832db8441c619ff37c7e4b0e
AUX mozc-2.23.2815.102-gcc-8.patch 496 BLAKE2B 318fcda19cf4f7e95920b5df4f5638621bcae992891941fa6f220d4dac1b2eac0faeda7a857a587baed41b361608f20c4bbda0d9a69a60b823572482c6789f46 SHA512 9c2b0e9695f4cd050f0d5f35d0e23f22715b9c6e5607629c7dc023560a5191bd755497fe6fe5306789c00e68d5bd9b7179d5515c982967788fca432134b71cad
+AUX mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch 40296 BLAKE2B 982f43fa68031eb0f779ec4d034fef838a4fce7834291db889c9edffba3df4acd5bfdf187dd4a52ee8fd0714de943f9d5112070cd69502e1449dab4dbf8543b2 SHA512 6e05b2f22663ddbfb24a8344928ec24c0b4cf523728c1623367970b8f263142af95c056c82d0827414833d5b9f26c3a024a04a688851021601a5cbcc1474e754
AUX mozc-2.23.2815.102-system_libraries.patch 9064 BLAKE2B 0cdf732a1bbf16d4af1d6dee81aacf3f3cb1f1c00c6aeb0fc12dac9dcd8611124e388e5fc721eb9b9472e073515d7457b182ee7cfe466b83bf319d572ae55240 SHA512 2d5b06e855f8c1889367b9b672e3ec81a037bc592872e28319e0180a0dcd177cdff817775a1a0f74ebf48e0b7558cf3b67953120411be753c662c43f409b05ce
DIST fcitx-mozc-2.23.2815.102.1.patch 295112 BLAKE2B 709b84f6eaed16da38a173f40ae7cccff362fd167e6deb4090ae8a9ec522ac8e11ccff3c9ef6433907249af8c9eb4b7be12d2c05564cabd45c25e26764286ed3 SHA512 e0d4645df919838f0fe31a97bf6dd759c222a696f68133f7584d2c771f70734ea634a25bebb03a756221000d3552423207ee5163d75778dbf480b6e267ba4cd0
DIST japanese-usage-dictionary-20120416091336.tar.gz 71051 BLAKE2B 08eecf0aa021e27a2813f58c2d37f1cec760448f6ae086ae7468b8a11575c6ef9f72f656cb4d53e0179b8a7b00f2d91ff51a0ad7825e078dcbac0810f1d8b3e1 SHA512 b7e997a979b6d50e49b9af5dc830ea4df0532f6ab1321b9ef14983f65bb54f1b2967375c82e07957ae7693ebbf43c9b56ecea6bfea8dd1fdaee444bd549d83a7
DIST mozc-2.23.2815.102.tar.gz 47739041 BLAKE2B 045a8a4a07e09cf923b67824111cdf672febc30256a6aef951ae779a3f582b3860042750d766120e376898c63be5b4baea870798a192cee34b0d48647e1ec5e6 SHA512 a3face616ca89990bca52371dcc8003604ebe0e9633116a64550add070152b1bc4d9b21e9f102c5afa6f8b1aa11d8dbc4bafbcebfaf4a12a934f085f245d548f
-EBUILD mozc-2.23.2815.102.ebuild 9527 BLAKE2B 61829c224c0025620af5603466c7a235804a04b50476996eec2ffba60c96df72e6b056a1617b319fcae9afc14193e24bf6ea2fd96e4bbab759255bf8d7f22647 SHA512 dbae8bf0241aca3b0fafb3af24945de4e78381bd65f6cc816a117a8ba5016969cf761d14a295e0a8c5ae5b931712a3ea116c537dc2083bfc2aa0461ad8495ee1
-EBUILD mozc-9999.ebuild 9367 BLAKE2B b37c588da2242e2a79b5c98d3fec80d40d912be681730b3f1d7bc9e8fc0c0761eee2cc0044bffe94b42435bccf6896463899c79d86364b526e10e265fb99f149 SHA512 8a343d5c717821994f8c4072c0546b4bd4961f0eaf197cc909b37563266ba049be119a73742a413970f8228c8f9ef72b9d3e4724abad8c9fa78ef67548b95bf1
+EBUILD mozc-2.23.2815.102.ebuild 9621 BLAKE2B 56f0645ce5d3075e8cd1151824f3f3d3caafffe569b62bbda103d8145c58832daf9212b583521f5467386bc647da8b7b327a8cfcb600725f674383658f5772a2 SHA512 4dc52da2c73b5852b55ebc06e73880cd4935c4f0197a1510ad3827184b64d0b5c19a3cdb9d5a09dc03688cecc40530a93d43d9a555bf5c8250acc8ee425f6777
+EBUILD mozc-9999.ebuild 9461 BLAKE2B 24399188dfbeaa18d19116300d0921c568c4a7518a5dc0ac1161f76358955b7a8b8c5ac2ac42e1c7be138ce335f9e7c43063736c80fab5bafc8c8bca06eb25a1 SHA512 bfd7fb36c1e7919fdf3f47c5414737bd37436564024b993936de164a85f6914b28d50cb9bbaaf4278d1e06f4c6292cc4d6a86b6e0c54ba7ee5e5dd305efec0ee
MISC metadata.xml 1127 BLAKE2B 55c44374c1d0c03845435544fb8bcd254bfa59faa54e773110fe2a9bcfba0f6863a1f5c167e3ca7d2a1108e566ae4d7d4155a1a1994bef006bbde906265fffe1 SHA512 8d1ee79d5e359c746627cc10ddae170088dd1be8a69379f60969e588c0c6141fea80ebcba0183a91e786116e8937c14e76888c9232526244aab584ed4ef27a54
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
new file mode 100644
index 000000000000..2cd757281545
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
@@ -0,0 +1,1039 @@
+https://github.com/google/mozc/issues/460
+
+--- /src/dictionary/user_dictionary.cc
++++ /src/dictionary/user_dictionary.cc
+@@ -289,7 +289,7 @@
+ }
+
+ auto_register_mode_ = false;
+- dic_->Load(*(storage.get()));
++ dic_->Load(storage.get()->user_dictionary_storage_base);
+ }
+
+ private:
+--- /src/dictionary/user_dictionary_session.cc
++++ /src/dictionary/user_dictionary_session.cc
+@@ -69,11 +69,11 @@
+ }
+
+ virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
+- if (storage->dictionaries_size() == 0) {
++ if (storage->user_dictionary_storage_base.dictionaries_size() == 0) {
+ return false;
+ }
+
+- storage->mutable_dictionaries()->RemoveLast();
++ storage->user_dictionary_storage_base.mutable_dictionaries()->RemoveLast();
+ return true;
+ }
+
+@@ -94,7 +94,7 @@
+ }
+
+ RepeatedPtrField<UserDictionary> *dictionaries =
+- storage->mutable_dictionaries();
++ storage->user_dictionary_storage_base.mutable_dictionaries();
+ dictionaries->AddAllocated(dictionary_.release());
+
+ // Adjust the position of the reverted dictionary.
+@@ -120,10 +120,10 @@
+ }
+
+ virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
+- if (storage->dictionaries_size() != 1) {
++ if (storage->user_dictionary_storage_base.dictionaries_size() != 1) {
+ return false;
+ }
+- dictionary_->Swap(storage->mutable_dictionaries(0));
++ dictionary_->Swap(storage->user_dictionary_storage_base.mutable_dictionaries(0));
+ return true;
+ }
+
+@@ -144,7 +144,7 @@
+ virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage, dictionary_id_);
++ &storage->user_dictionary_storage_base, dictionary_id_);
+ if (dictionary == NULL) {
+ return false;
+ }
+@@ -169,7 +169,7 @@
+ virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage, dictionary_id_);
++ &storage->user_dictionary_storage_base, dictionary_id_);
+ if (dictionary == NULL || dictionary->entries_size() == 0) {
+ return false;
+ }
+@@ -195,7 +195,7 @@
+ virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage, dictionary_id_);
++ &storage->user_dictionary_storage_base, dictionary_id_);
+ if (dictionary == NULL ||
+ index_ < 0 || dictionary->entries_size() <= index_) {
+ return false;
+@@ -240,7 +240,7 @@
+ virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage, dictionary_id_);
++ &storage->user_dictionary_storage_base, dictionary_id_);
+ if (dictionary == NULL) {
+ return false;
+ }
+@@ -306,7 +306,7 @@
+ virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage, dictionary_id_);
++ &storage->user_dictionary_storage_base, dictionary_id_);
+ if (dictionary == NULL) {
+ return false;
+ }
+@@ -345,7 +345,7 @@
+
+ // TODO(hidehiko) move this to header.
+ const UserDictionaryStorage &UserDictionarySession::storage() const {
+- return *storage_;
++ return storage_->user_dictionary_storage_base;
+ }
+ mozc::UserDictionaryStorage *UserDictionarySession::mutable_storage() {
+ return storage_.get();
+@@ -464,7 +464,7 @@
+ const string &dictionary_name, uint64 *new_dictionary_id) {
+ UserDictionaryCommandStatus::Status status =
+ UserDictionaryUtil::CreateDictionary(
+- storage_.get(), dictionary_name, new_dictionary_id);
++ &storage_->user_dictionary_storage_base, dictionary_name, new_dictionary_id);
+ if (status == UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
+ AddUndoCommand(new UndoCreateDictionaryCommand);
+ }
+@@ -488,7 +488,7 @@
+ int original_index;
+ UserDictionary *deleted_dictionary;
+ if (!UserDictionaryUtil::DeleteDictionary(
+- storage_.get(), dictionary_id,
++ &storage_->user_dictionary_storage_base, dictionary_id,
+ &original_index, &deleted_dictionary)) {
+ // Failed to delete the dictionary.
+ return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
+@@ -510,7 +510,7 @@
+ uint64 dictionary_id, const string &dictionary_name) {
+ string original_name;
+ const UserDictionary *dictionary =
+- UserDictionaryUtil::GetUserDictionaryById(*storage_, dictionary_id);
++ UserDictionaryUtil::GetUserDictionaryById(storage_->user_dictionary_storage_base, dictionary_id);
+ if (dictionary != NULL) {
+ // Note that if dictionary is null, it means the dictionary_id is invalid
+ // so following RenameDictionary will fail, and error handling is done
+@@ -547,7 +547,7 @@
+ uint64 dictionary_id, const UserDictionary::Entry &entry) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage_.get(), dictionary_id);
++ &storage_->user_dictionary_storage_base, dictionary_id);
+ if (dictionary == NULL) {
+ return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
+ }
+@@ -575,7 +575,7 @@
+ uint64 dictionary_id, int index, const UserDictionary::Entry &entry) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage_.get(), dictionary_id);
++ &storage_->user_dictionary_storage_base, dictionary_id);
+ if (dictionary == NULL) {
+ return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
+ }
+@@ -604,7 +604,7 @@
+ uint64 dictionary_id, const std::vector<int> &index_list) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage_.get(), dictionary_id);
++ &storage_->user_dictionary_storage_base, dictionary_id);
+ if (dictionary == NULL) {
+ return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
+ }
+@@ -644,7 +644,7 @@
+ uint64 dictionary_id, const string &data) {
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage_.get(), dictionary_id);
++ &storage_->user_dictionary_storage_base, dictionary_id);
+ if (dictionary == NULL) {
+ return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
+ }
+@@ -699,7 +699,7 @@
+ uint64 *new_dictionary_id) {
+ UserDictionaryCommandStatus::Status status =
+ UserDictionaryUtil::CreateDictionary(
+- storage_.get(), dictionary_name, new_dictionary_id);
++ &storage_->user_dictionary_storage_base, dictionary_name, new_dictionary_id);
+ if (status != UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
+ return status;
+ }
+@@ -709,7 +709,7 @@
+
+ UserDictionary *dictionary =
+ UserDictionaryUtil::GetMutableUserDictionaryById(
+- storage_.get(), *new_dictionary_id);
++ &storage_->user_dictionary_storage_base, *new_dictionary_id);
+ if (dictionary == NULL) {
+ // The dictionary should be always found.
+ return UserDictionaryCommandStatus::UNKNOWN_ERROR;
+@@ -719,7 +719,7 @@
+ }
+
+ bool UserDictionarySession::EnsureNonEmptyStorage() {
+- if (storage_->dictionaries_size() > 0) {
++ if (storage_->user_dictionary_storage_base.dictionaries_size() > 0) {
+ // The storage already has at least one dictionary. Do nothing.
+ return false;
+ }
+@@ -728,7 +728,7 @@
+ uint64 new_dictionary_id;
+ UserDictionaryCommandStatus::Status status =
+ UserDictionaryUtil::CreateDictionary(
+- storage_.get(), default_dictionary_name_, &new_dictionary_id);
++ &storage_->user_dictionary_storage_base, default_dictionary_name_, &new_dictionary_id);
+ CHECK_EQ(
+ status, UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS);
+ return true;
+@@ -755,7 +755,7 @@
+
+ void UserDictionarySession::ClearDictionariesAndUndoHistory() {
+ ScopedUserDictionaryLocker l(storage_.get());
+- storage_->clear_dictionaries();
++ storage_->user_dictionary_storage_base.clear_dictionaries();
+ ClearUndoHistory();
+ }
+
+--- /src/dictionary/user_dictionary_session_test.cc
++++ /src/dictionary/user_dictionary_session_test.cc
+@@ -95,12 +95,12 @@
+
+ ASSERT_EQ(UserDictionaryCommandStatus::FILE_NOT_FOUND, session.Load());
+
+- session.mutable_storage()->set_version(10);
++ session.mutable_storage()->user_dictionary_storage_base.set_version(10);
+ ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
+ session.Save());
+
+ // Clear once, in order to make sure that Load is actually working.
+- session.mutable_storage()->Clear();
++ session.mutable_storage()->user_dictionary_storage_base.Clear();
+ ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
+ session.Load());
+
+@@ -130,7 +130,7 @@
+
+ // Create huge dummy data.
+ {
+- UserDictionaryStorage *storage = session.mutable_storage();
++ UserDictionaryStorage *storage = &session.mutable_storage()->user_dictionary_storage_base;
+ for (int i = 0; i < 100; ++i) {
+ UserDictionary *dictionary = storage->add_dictionaries();
+ for (int j = 0; j < 1000; ++j) {
+@@ -147,7 +147,7 @@
+ ASSERT_EQ(UserDictionaryCommandStatus::FILE_SIZE_LIMIT_EXCEEDED,
+ session.Save());
+
+- session.mutable_storage()->Clear();
++ session.mutable_storage()->user_dictionary_storage_base.Clear();
+ ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
+ session.Load());
+
+@@ -191,7 +191,7 @@
+
+ while (session.storage().dictionaries_size() <
+ ::mozc::UserDictionaryStorage::max_dictionary_size()) {
+- session.mutable_storage()->add_dictionaries();
++ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
+ }
+ EXPECT_EQ(UserDictionaryCommandStatus::DICTIONARY_SIZE_LIMIT_EXCEEDED,
+ session.CreateDictionary("dictionary 2", &dummy_dictionary_id));
+@@ -204,7 +204,7 @@
+ const uint64 kDummyId = 10;
+ {
+ UserDictionary *user_dictionary =
+- session.mutable_storage()->add_dictionaries();
++ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
+ user_dictionary->set_id(kDummyId);
+ }
+
+@@ -229,7 +229,7 @@
+ const uint64 kDummyId = 10;
+ {
+ UserDictionary *user_dictionary =
+- session.mutable_storage()->add_dictionaries();
++ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
+ user_dictionary->set_id(kDummyId);
+ }
+
+--- /src/dictionary/user_dictionary_storage.cc
++++ /src/dictionary/user_dictionary_storage.cc
+@@ -109,7 +109,7 @@
+ mozc::protobuf::io::IstreamInputStream zero_copy_input(&ifs);
+ mozc::protobuf::io::CodedInputStream decoder(&zero_copy_input);
+ decoder.SetTotalBytesLimit(kDefaultTotalBytesLimit, -1);
+- if (!ParseFromCodedStream(&decoder)) {
++ if (!user_dictionary_storage_base.ParseFromCodedStream(&decoder)) {
+ LOG(ERROR) << "Failed to parse";
+ if (!decoder.ConsumedEntireMessage() || !ifs.eof()) {
+ LOG(ERROR) << "ParseFromStream failed: file seems broken";
+@@ -137,11 +137,11 @@
+ }
+
+ // Check dictionary id here. if id is 0, assign random ID.
+- for (int i = 0; i < dictionaries_size(); ++i) {
+- const UserDictionary &dict = dictionaries(i);
++ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
++ const UserDictionary &dict = user_dictionary_storage_base.dictionaries(i);
+ if (dict.id() == 0) {
+- mutable_dictionaries(i)->set_id(
+- UserDictionaryUtil::CreateNewDictionaryId(*this));
++ user_dictionary_storage_base.mutable_dictionaries(i)->set_id(
++ UserDictionaryUtil::CreateNewDictionaryId(this->user_dictionary_storage_base));
+ }
+ }
+
+@@ -171,7 +171,7 @@
+ return false;
+ }
+
+- if (!SerializeToOstream(&ofs)) {
++ if (!user_dictionary_storage_base.SerializeToOstream(&ofs)) {
+ LOG(ERROR) << "SerializeToString failed";
+ last_error_type_ = SYNC_FAILURE;
+ return false;
+@@ -227,7 +227,7 @@
+ return false;
+ }
+
+- const UserDictionary &dic = dictionaries(index);
++ const UserDictionary &dic = user_dictionary_storage_base.dictionaries(index);
+ for (size_t i = 0; i < dic.entries_size(); ++i) {
+ const UserDictionaryEntry &entry = dic.entries(i);
+ ofs << entry.key() << "\t" << entry.value() << "\t"
+@@ -241,7 +241,7 @@
+ bool UserDictionaryStorage::CreateDictionary(
+ const string &dic_name, uint64 *new_dic_id) {
+ UserDictionaryCommandStatus::Status status =
+- UserDictionaryUtil::CreateDictionary(this, dic_name, new_dic_id);
++ UserDictionaryUtil::CreateDictionary(&this->user_dictionary_storage_base, dic_name, new_dic_id);
+ // Update last_error_type_
+ switch (status) {
+ case UserDictionaryCommandStatus::DICTIONARY_NAME_EMPTY:
+@@ -273,7 +273,7 @@
+ }
+
+ bool UserDictionaryStorage::DeleteDictionary(uint64 dic_id) {
+- if (!UserDictionaryUtil::DeleteDictionary(this, dic_id, NULL, NULL)) {
++ if (!UserDictionaryUtil::DeleteDictionary(&this->user_dictionary_storage_base, dic_id, NULL, NULL)) {
+ // Failed to delete dictionary.
+ last_error_type_ = INVALID_DICTIONARY_ID;
+ return false;
+@@ -304,8 +304,8 @@
+ return true;
+ }
+
+- for (int i = 0; i < dictionaries_size(); ++i) {
+- if (dic_name == dictionaries(i).name()) {
++ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
++ if (dic_name == user_dictionary_storage_base.dictionaries(i).name()) {
+ last_error_type_ = DUPLICATED_DICTIONARY_NAME;
+ LOG(ERROR) << "duplicated dictionary name";
+ return false;
+@@ -318,14 +318,14 @@
+ }
+
+ int UserDictionaryStorage::GetUserDictionaryIndex(uint64 dic_id) const {
+- return UserDictionaryUtil::GetUserDictionaryIndexById(*this, dic_id);
++ return UserDictionaryUtil::GetUserDictionaryIndexById(this->user_dictionary_storage_base, dic_id);
+ }
+
+ bool UserDictionaryStorage::GetUserDictionaryId(const string &dic_name,
+ uint64 *dic_id) {
+- for (size_t i = 0; i < dictionaries_size(); ++i) {
+- if (dic_name == dictionaries(i).name()) {
+- *dic_id = dictionaries(i).id();
++ for (size_t i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
++ if (dic_name == user_dictionary_storage_base.dictionaries(i).name()) {
++ *dic_id = user_dictionary_storage_base.dictionaries(i).id();
+ return true;
+ }
+ }
+@@ -335,7 +335,7 @@
+
+ user_dictionary::UserDictionary *UserDictionaryStorage::GetUserDictionary(
+ uint64 dic_id) {
+- return UserDictionaryUtil::GetMutableUserDictionaryById(this, dic_id);
++ return UserDictionaryUtil::GetMutableUserDictionaryById(&this->user_dictionary_storage_base, dic_id);
+ }
+
+ UserDictionaryStorage::UserDictionaryStorageErrorType
+@@ -352,8 +352,8 @@
+ }
+
+ int auto_index = -1;
+- for (int i = 0; i < dictionaries_size(); ++i) {
+- if (dictionaries(i).name() == kAutoRegisteredDictionaryName) {
++ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
++ if (user_dictionary_storage_base.dictionaries(i).name() == kAutoRegisteredDictionaryName) {
+ auto_index = i;
+ break;
+ }
+@@ -361,17 +361,17 @@
+
+ UserDictionary *dic = NULL;
+ if (auto_index == -1) {
+- if (UserDictionaryUtil::IsStorageFull(*this)) {
++ if (UserDictionaryUtil::IsStorageFull(this->user_dictionary_storage_base)) {
+ last_error_type_ = TOO_MANY_DICTIONARIES;
+ LOG(ERROR) << "too many dictionaries";
+ UnLock();
+ return false;
+ }
+- dic = add_dictionaries();
+- dic->set_id(UserDictionaryUtil::CreateNewDictionaryId(*this));
++ dic = user_dictionary_storage_base.add_dictionaries();
++ dic->set_id(UserDictionaryUtil::CreateNewDictionaryId(this->user_dictionary_storage_base));
+ dic->set_name(kAutoRegisteredDictionaryName);
+ } else {
+- dic = mutable_dictionaries(auto_index);
++ dic = user_dictionary_storage_base.mutable_dictionaries(auto_index);
+ }
+
+ if (dic == NULL) {
+@@ -410,13 +410,13 @@
+ }
+
+ bool UserDictionaryStorage::ConvertSyncDictionariesToNormalDictionaries() {
+- if (CountSyncableDictionaries(*this) == 0) {
++ if (CountSyncableDictionaries(this->user_dictionary_storage_base) == 0) {
+ return false;
+ }
+
+- for (int dictionary_index = dictionaries_size() - 1;
++ for (int dictionary_index = user_dictionary_storage_base.dictionaries_size() - 1;
+ dictionary_index >= 0; --dictionary_index) {
+- UserDictionary *dic = mutable_dictionaries(dictionary_index);
++ UserDictionary *dic = user_dictionary_storage_base.mutable_dictionaries(dictionary_index);
+ if (!dic->syncable()) {
+ continue;
+ }
+@@ -433,10 +433,10 @@
+
+ // Delete removed or unused sync dictionaries.
+ if (dic->removed() || dic->entries_size() == 0) {
+- for (int i = dictionary_index + 1; i < dictionaries_size(); ++i) {
+- mutable_dictionaries()->SwapElements(i - 1, i);
++ for (int i = dictionary_index + 1; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
++ user_dictionary_storage_base.mutable_dictionaries()->SwapElements(i - 1, i);
+ }
+- mutable_dictionaries()->RemoveLast();
++ user_dictionary_storage_base.mutable_dictionaries()->RemoveLast();
+ continue;
+ }
+
+@@ -445,7 +445,7 @@
+ kDictionaryNameConvertedFromSyncableDictionary;
+ int index = 0;
+ while (UserDictionaryUtil::ValidateDictionaryName(
+- *this, new_dictionary_name)
++ this->user_dictionary_storage_base, new_dictionary_name)
+ != UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
+ ++index;
+ new_dictionary_name = Util::StringPrintf(
+@@ -456,7 +456,7 @@
+ dic->set_syncable(false);
+ }
+
+- DCHECK_EQ(0, CountSyncableDictionaries(*this));
++ DCHECK_EQ(0, CountSyncableDictionaries(this->user_dictionary_storage_base));
+
+ return true;
+ }
+@@ -487,7 +487,7 @@
+ bool UserDictionaryStorage::IsValidDictionaryName(const string &name) {
+ UserDictionaryCommandStatus::Status status =
+ UserDictionaryUtil::ValidateDictionaryName(
+- UserDictionaryStorage::default_instance(), name);
++ user_dictionary::UserDictionaryStorage::default_instance(), name);
+
+ // Update last_error_type_.
+ switch (status) {
+--- /src/dictionary/user_dictionary_storage.h
++++ /src/dictionary/user_dictionary_storage.h
+@@ -72,13 +72,15 @@
+ class Mutex;
+ class ProcessMutex;
+
+-// Inherit from ProtocolBuffer
+-// TODO(hidehiko): Get rid of this implementation.
+-class UserDictionaryStorage : public user_dictionary::UserDictionaryStorage {
++class UserDictionaryStorage {
+ public:
+ typedef user_dictionary::UserDictionary UserDictionary;
+ typedef user_dictionary::UserDictionary::Entry UserDictionaryEntry;
+
++ // Instance of base class generated by Protocol Buffers compiler.
++ // Regular inheritance strongly discouraged.
++ user_dictionary::UserDictionaryStorage user_dictionary_storage_base;
++
+ enum UserDictionaryStorageErrorType {
+ USER_DICTIONARY_STORAGE_NO_ERROR = 0, // default
+ FILE_NOT_EXISTS,
+--- /src/dictionary/user_dictionary_storage_test.cc
++++ /src/dictionary/user_dictionary_storage_test.cc
+@@ -118,13 +118,13 @@
+ const size_t kDictionariesSize = 3;
+ uint64 id[kDictionariesSize];
+
+- const size_t dict_size = storage.dictionaries_size();
++ const size_t dict_size = storage.user_dictionary_storage_base.dictionaries_size();
+
+ for (size_t i = 0; i < kDictionariesSize; ++i) {
+ EXPECT_TRUE(storage.CreateDictionary(
+ "test" + std::to_string(static_cast<uint32>(i)),
+ &id[i]));
+- EXPECT_EQ(i + 1 + dict_size, storage.dictionaries_size());
++ EXPECT_EQ(i + 1 + dict_size, storage.user_dictionary_storage_base.dictionaries_size());
+ }
+
+ for (size_t i = 0; i < kDictionariesSize; ++i) {
+@@ -133,7 +133,7 @@
+ }
+
+ for (size_t i = 0; i < kDictionariesSize; ++i) {
+- EXPECT_EQ(storage.mutable_dictionaries(i + dict_size),
++ EXPECT_EQ(storage.user_dictionary_storage_base.mutable_dictionaries(i + dict_size),
+ storage.GetUserDictionary(id[i]));
+ EXPECT_EQ(NULL, storage.GetUserDictionary(id[i] + 1));
+ }
+@@ -165,7 +165,7 @@
+ EXPECT_FALSE(storage.DeleteDictionary(0));
+
+ EXPECT_TRUE(storage.DeleteDictionary(id[1]));
+- EXPECT_EQ(kDictionariesSize + dict_size - 1, storage.dictionaries_size());
++ EXPECT_EQ(kDictionariesSize + dict_size - 1, storage.user_dictionary_storage_base.dictionaries_size());
+ }
+
+ TEST_F(UserDictionaryStorageTest, DeleteTest) {
+@@ -174,7 +174,7 @@
+
+ // repeat 10 times
+ for (int i = 0; i < 10; ++i) {
+- storage.Clear();
++ storage.user_dictionary_storage_base.Clear();
+ std::vector<uint64> ids(100);
+ for (size_t i = 0; i < ids.size(); ++i) {
+ EXPECT_TRUE(storage.CreateDictionary(
+@@ -191,10 +191,10 @@
+ alive.push_back(ids[i]);
+ }
+
+- EXPECT_EQ(alive.size(), storage.dictionaries_size());
++ EXPECT_EQ(alive.size(), storage.user_dictionary_storage_base.dictionaries_size());
+
+ for (size_t i = 0; i < alive.size(); ++i) {
+- EXPECT_EQ(alive[i], storage.dictionaries(i).id());
++ EXPECT_EQ(alive[i], storage.user_dictionary_storage_base.dictionaries(i).id());
+ }
+ }
+ }
+@@ -268,7 +268,7 @@
+ const size_t entry_size = Util::Random(100) + 1;
+ for (size_t j = 0; j < entry_size; ++j) {
+ UserDictionaryStorage::UserDictionary *dic =
+- storage1.mutable_dictionaries(i);
++ storage1.user_dictionary_storage_base.mutable_dictionaries(i);
+ UserDictionaryStorage::UserDictionaryEntry *entry =
+ dic->add_entries();
+ entry->set_key(GenRandomString(10));
+@@ -288,7 +288,7 @@
+ EXPECT_TRUE(storage2.Load());
+ }
+
+- EXPECT_EQ(storage1.DebugString(), storage2.DebugString());
++ EXPECT_EQ(storage1.user_dictionary_storage_base.DebugString(), storage2.user_dictionary_storage_base.DebugString());
+ }
+ }
+
+@@ -352,7 +352,7 @@
+ uint64 dict_id = 0;
+ ASSERT_TRUE(storage.CreateDictionary(data.dictionary_name, &dict_id));
+ UserDictionaryStorage::UserDictionary *dict =
+- storage.mutable_dictionaries(storage.GetUserDictionaryIndex(dict_id));
++ storage.user_dictionary_storage_base.mutable_dictionaries(storage.GetUserDictionaryIndex(dict_id));
+ dict->set_syncable(data.is_sync_dictionary);
+ dict->set_removed(data.is_removed_dictionary);
+ if (data.has_normal_entry) {
+@@ -369,7 +369,7 @@
+ entry->set_removed(true);
+ }
+ }
+- EXPECT_EQ(9, UserDictionaryStorage::CountSyncableDictionaries(storage));
++ EXPECT_EQ(9, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
+
+ ASSERT_TRUE(storage.ConvertSyncDictionariesToNormalDictionaries());
+
+@@ -385,12 +385,12 @@
+ { true, kDictionaryNameConvertedFromSyncableDictionary },
+ };
+
+- EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage));
+- ASSERT_EQ(arraysize(expected_data), storage.dictionaries_size());
++ EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
++ ASSERT_EQ(arraysize(expected_data), storage.user_dictionary_storage_base.dictionaries_size());
+ for (size_t i = 0; i < arraysize(expected_data); ++i) {
+ SCOPED_TRACE(Util::StringPrintf("verify %d", static_cast<int>(i)));
+ const ExpectedData &expected = expected_data[i];
+- const UserDictionaryStorage::UserDictionary &dict = storage.dictionaries(i);
++ const UserDictionaryStorage::UserDictionary &dict = storage.user_dictionary_storage_base.dictionaries(i);
+
+ EXPECT_EQ(expected.dictionary_name, dict.name());
+ EXPECT_FALSE(dict.syncable());
+@@ -404,42 +404,42 @@
+ }
+
+ // Test duplicated dictionary name.
+- storage.Clear();
++ storage.user_dictionary_storage_base.Clear();
+ {
+ uint64 dict_id = 0;
+ storage.CreateDictionary(
+ UserDictionaryStorage::default_sync_dictionary_name(), &dict_id);
+ storage.CreateDictionary(
+ kDictionaryNameConvertedFromSyncableDictionary, &dict_id);
+- ASSERT_EQ(2, storage.dictionaries_size());
++ ASSERT_EQ(2, storage.user_dictionary_storage_base.dictionaries_size());
+ UserDictionaryStorage::UserDictionary *dict;
+- dict = storage.mutable_dictionaries(0);
++ dict = storage.user_dictionary_storage_base.mutable_dictionaries(0);
+ dict->set_syncable(true);
+ dict->add_entries()->set_key("0");
+- dict = storage.mutable_dictionaries(1);
++ dict = storage.user_dictionary_storage_base.mutable_dictionaries(1);
+ dict->set_syncable(false);
+ dict->add_entries()->set_key("1");
+ }
+ ASSERT_TRUE(storage.ConvertSyncDictionariesToNormalDictionaries());
+- EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage));
+- EXPECT_EQ(2, storage.dictionaries_size());
++ EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
++ EXPECT_EQ(2, storage.user_dictionary_storage_base.dictionaries_size());
+ EXPECT_EQ(Util::StringPrintf("%s_1",
+ kDictionaryNameConvertedFromSyncableDictionary),
+- storage.dictionaries(0).name());
++ storage.user_dictionary_storage_base.dictionaries(0).name());
+ EXPECT_EQ(kDictionaryNameConvertedFromSyncableDictionary,
+- storage.dictionaries(1).name());
++ storage.user_dictionary_storage_base.dictionaries(1).name());
+ }
+
+ TEST_F(UserDictionaryStorageTest, AddToAutoRegisteredDictionary) {
+ {
+ UserDictionaryStorage storage(GetUserDictionaryFile());
+- EXPECT_EQ(0, storage.dictionaries_size());
++ EXPECT_EQ(0, storage.user_dictionary_storage_base.dictionaries_size());
+ EXPECT_TRUE(storage.AddToAutoRegisteredDictionary(
+ "key1", "value1", UserDictionary::NOUN));
+- EXPECT_EQ(1, storage.dictionaries_size());
+- EXPECT_EQ(1, storage.dictionaries(0).entries_size());
++ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
++ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
+ const UserDictionaryStorage::UserDictionaryEntry &entry1 =
+- storage.dictionaries(0).entries(0);
++ storage.user_dictionary_storage_base.dictionaries(0).entries(0);
+ EXPECT_EQ("key1", entry1.key());
+ EXPECT_EQ("value1", entry1.value());
+ EXPECT_EQ(UserDictionary::NOUN, entry1.pos());
+@@ -447,10 +447,10 @@
+
+ EXPECT_TRUE(storage.AddToAutoRegisteredDictionary(
+ "key2", "value2", UserDictionary::NOUN));
+- EXPECT_EQ(1, storage.dictionaries_size());
+- EXPECT_EQ(2, storage.dictionaries(0).entries_size());
++ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
++ EXPECT_EQ(2, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
+ const UserDictionaryStorage::UserDictionaryEntry &entry2 =
+- storage.dictionaries(0).entries(1);
++ storage.user_dictionary_storage_base.dictionaries(0).entries(1);
+ EXPECT_EQ("key2", entry2.key());
+ EXPECT_EQ("value2", entry2.value());
+ EXPECT_EQ(UserDictionary::NOUN, entry2.pos());
+@@ -474,7 +474,7 @@
+ {
+ UserDictionaryStorage storage(GetUserDictionaryFile());
+ {
+- UserDictionary *dictionary = storage.add_dictionaries();
++ UserDictionary *dictionary = storage.user_dictionary_storage_base.add_dictionaries();
+ dictionary->set_id(kDummyDictionaryId);
+ UserDictionary::Entry *entry = dictionary->add_entries();
+ entry->set_key("key");
+--- /src/dictionary/user_dictionary_test.cc
++++ /src/dictionary/user_dictionary_test.cc
+@@ -334,9 +334,9 @@
+ std::istringstream is(contents);
+ CHECK(is.good());
+
+- storage->Clear();
++ storage->user_dictionary_storage_base.Clear();
+ UserDictionaryStorage::UserDictionary *dic
+- = storage->add_dictionaries();
++ = storage->user_dictionary_storage_base.add_dictionaries();
+ CHECK(dic);
+
+ string line;
+@@ -389,7 +389,7 @@
+ {
+ UserDictionaryStorage storage("");
+ UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
+- dic->Load(storage);
++ dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ // A normal lookup operation.
+@@ -425,7 +425,7 @@
+ {
+ UserDictionaryStorage storage("");
+ LoadFromString(kUserDictionary1, &storage);
+- dic->Load(storage);
++ dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ // A normal lookup again.
+@@ -450,7 +450,7 @@
+ {
+ UserDictionaryStorage storage("");
+ LoadFromString(kUserDictionary0, &storage);
+- dic->Load(storage);
++ dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ // A normal lookup operation.
+@@ -480,7 +480,7 @@
+ {
+ UserDictionaryStorage storage("");
+ LoadFromString(kUserDictionary1, &storage);
+- dic->Load(storage);
++ dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ // A normal lookup.
+@@ -504,7 +504,7 @@
+ {
+ UserDictionaryStorage storage("");
+ LoadFromString(kUserDictionary0, &storage);
+- dic->Load(storage);
++ dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ // A normal lookup operation.
+@@ -540,7 +540,7 @@
+ uint64 id = 0;
+ EXPECT_TRUE(storage.CreateDictionary("test", &id));
+ UserDictionaryStorage::UserDictionary *dic =
+- storage.mutable_dictionaries(0);
++ storage.user_dictionary_storage_base.mutable_dictionaries(0);
+
+ // "名詞"
+ UserDictionaryStorage::UserDictionaryEntry *entry =
+@@ -555,7 +555,7 @@
+ entry->set_value("suggest_only");
+ entry->set_pos(user_dictionary::UserDictionary::SUGGESTION_ONLY);
+
+- user_dic->Load(storage);
++ user_dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ // "suggestion_only" should not be looked up.
+@@ -577,7 +577,7 @@
+ {
+ UserDictionaryStorage storage("");
+ UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
+- dic->Load(storage);
++ dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ TestLookupPrefixHelper(nullptr, 0, "start", 4, *dic);
+@@ -612,7 +612,7 @@
+ uint64 id = 0;
+ EXPECT_TRUE(storage.CreateDictionary("test", &id));
+ UserDictionaryStorage::UserDictionary *dic =
+- storage.mutable_dictionaries(0);
++ storage.user_dictionary_storage_base.mutable_dictionaries(0);
+ for (size_t j = 0; j < 10000; ++j) {
+ UserDictionaryStorage::UserDictionaryEntry *entry =
+ dic->add_entries();
+@@ -681,15 +681,15 @@
+ UserDictionaryStorage storage(filename);
+ EXPECT_TRUE(storage.Load());
+ int index = 0;
+- EXPECT_EQ(1, storage.dictionaries_size());
+- EXPECT_EQ(100, storage.dictionaries(index).entries_size());
++ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
++ EXPECT_EQ(100, storage.user_dictionary_storage_base.dictionaries(index).entries_size());
+ for (int i = 0; i < 100; ++i) {
+ EXPECT_EQ("key" + std::to_string(i),
+- storage.dictionaries(index).entries(i).key());
++ storage.user_dictionary_storage_base.dictionaries(index).entries(i).key());
+ EXPECT_EQ("value" + std::to_string(i),
+- storage.dictionaries(index).entries(i).value());
++ storage.user_dictionary_storage_base.dictionaries(index).entries(i).value());
+ EXPECT_EQ(user_dictionary::UserDictionary::NOUN,
+- storage.dictionaries(index).entries(i).pos());
++ storage.user_dictionary_storage_base.dictionaries(index).entries(i).pos());
+ }
+ }
+
+@@ -722,12 +722,12 @@
+ {
+ UserDictionaryStorage storage(filename);
+ EXPECT_TRUE(storage.Load());
+- EXPECT_EQ(1, storage.dictionaries_size());
+- EXPECT_EQ(1, storage.dictionaries(0).entries_size());
+- EXPECT_EQ("key", storage.dictionaries(0).entries(0).key());
+- EXPECT_EQ("value", storage.dictionaries(0).entries(0).value());
++ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
++ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
++ EXPECT_EQ("key", storage.user_dictionary_storage_base.dictionaries(0).entries(0).key());
++ EXPECT_EQ("value", storage.user_dictionary_storage_base.dictionaries(0).entries(0).value());
+ EXPECT_EQ(user_dictionary::UserDictionary::NOUN,
+- storage.dictionaries(0).entries(0).pos());
++ storage.user_dictionary_storage_base.dictionaries(0).entries(0).pos());
+ }
+ }
+
+@@ -746,7 +746,7 @@
+ uint64 id = 0;
+ EXPECT_TRUE(storage.CreateDictionary("test", &id));
+ UserDictionaryStorage::UserDictionary *dic =
+- storage.mutable_dictionaries(0);
++ storage.user_dictionary_storage_base.mutable_dictionaries(0);
+ for (size_t j = 0; j < 10000; ++j) {
+ UserDictionaryStorage::UserDictionaryEntry *entry =
+ dic->add_entries();
+@@ -770,7 +770,7 @@
+
+ suppression_dictionary_->Lock();
+ EXPECT_TRUE(suppression_dictionary_->IsLocked());
+- user_dic->Load(storage);
++ user_dic->Load(storage.user_dictionary_storage_base);
+ EXPECT_FALSE(suppression_dictionary_->IsLocked());
+
+ for (size_t j = 0; j < 10; ++j) {
+@@ -782,11 +782,11 @@
+
+ // Remove suppression entry
+ {
+- storage.Clear();
++ storage.user_dictionary_storage_base.Clear();
+ uint64 id = 0;
+ EXPECT_TRUE(storage.CreateDictionary("test", &id));
+ UserDictionaryStorage::UserDictionary *dic =
+- storage.mutable_dictionaries(0);
++ storage.user_dictionary_storage_base.mutable_dictionaries(0);
+ for (size_t j = 0; j < 10000; ++j) {
+ UserDictionaryStorage::UserDictionaryEntry *entry =
+ dic->add_entries();
+@@ -798,7 +798,7 @@
+ }
+
+ suppression_dictionary_->Lock();
+- user_dic->Load(storage);
++ user_dic->Load(storage.user_dictionary_storage_base);
+ EXPECT_FALSE(suppression_dictionary_->IsLocked());
+
+ for (size_t j = 0; j < 10; ++j) {
+@@ -825,7 +825,7 @@
+ uint64 id = 0;
+ EXPECT_TRUE(storage.CreateDictionary("test", &id));
+ UserDictionaryStorage::UserDictionary *dic =
+- storage.mutable_dictionaries(0);
++ storage.user_dictionary_storage_base.mutable_dictionaries(0);
+
+ for (size_t j = 0; j < 10; ++j) {
+ UserDictionaryStorage::UserDictionaryEntry *entry =
+@@ -845,7 +845,7 @@
+ entry->set_pos(user_dictionary::UserDictionary::SUGGESTION_ONLY);
+ }
+
+- user_dic->Load(storage);
++ user_dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ {
+@@ -878,7 +878,7 @@
+ UserDictionaryStorage storage("");
+
+ {
+- UserDictionaryStorage::UserDictionary *dic1 = storage.add_dictionaries();
++ UserDictionaryStorage::UserDictionary *dic1 = storage.user_dictionary_storage_base.add_dictionaries();
+ CHECK(dic1);
+ UserDictionaryStorage::UserDictionaryEntry *entry;
+ entry = dic1->add_entries();
+@@ -893,7 +893,7 @@
+ entry->set_pos(user_dictionary::UserDictionary::NOUN);
+ }
+ {
+- UserDictionaryStorage::UserDictionary *dic2 = storage.add_dictionaries();
++ UserDictionaryStorage::UserDictionary *dic2 = storage.user_dictionary_storage_base.add_dictionaries();
+ CHECK(dic2);
+ UserDictionaryStorage::UserDictionaryEntry *entry;
+ entry = dic2->add_entries();
+@@ -912,7 +912,7 @@
+ entry->set_value("value5");
+ entry->set_pos(user_dictionary::UserDictionary::NOUN);
+ }
+- dic->Load(storage);
++ dic->Load(storage.user_dictionary_storage_base);
+
+ EXPECT_INTEGER_STATS("UserRegisteredWord", 5);
+ }
+@@ -925,7 +925,7 @@
+ {
+ UserDictionaryStorage storage("");
+ UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
+- dic->Load(storage);
++ dic->Load(storage.user_dictionary_storage_base);
+ }
+
+ // Entry is in user dictionary but has no comment.
+--- /src/gui/word_register_dialog/word_register_dialog.cc
++++ /src/gui/word_register_dialog/word_register_dialog.cc
+@@ -298,7 +298,7 @@
+ }
+
+ UserDictionary *dic =
+- session_->mutable_storage()->mutable_dictionaries(index);
++ session_->mutable_storage()->user_dictionary_storage_base.mutable_dictionaries(index);
+ CHECK(dic);
+
+ if (dic->name() != DictionarycomboBox->currentText().toStdString()) {
+--- /src/prediction/user_history_predictor.cc
++++ /src/prediction/user_history_predictor.cc
+@@ -291,23 +291,23 @@
+ return false;
+ }
+
+- if (!ParseFromString(input)) {
++ if (!user_history_base.ParseFromString(input)) {
+ LOG(ERROR) << "ParseFromString failed. message looks broken";
+ return false;
+ }
+
+- VLOG(1) << "Loaded user histroy, size=" << entries_size();
++ VLOG(1) << "Loaded user histroy, size=" << user_history_base.entries_size();
+ return true;
+ }
+
+ bool UserHistoryStorage::Save() const {
+- if (entries_size() == 0) {
++ if (user_history_base.entries_size() == 0) {
+ LOG(WARNING) << "etries size is 0. Not saved";
+ return false;
+ }
+
+ string output;
+- if (!AppendToString(&output)) {
++ if (!user_history_base.AppendToString(&output)) {
+ LOG(ERROR) << "AppendToString failed";
+ return false;
+ }
+@@ -494,12 +494,12 @@
+ return false;
+ }
+
+- for (size_t i = 0; i < history.entries_size(); ++i) {
+- dic_->Insert(EntryFingerprint(history.entries(i)),
+- history.entries(i));
++ for (size_t i = 0; i < history.user_history_base.entries_size(); ++i) {
++ dic_->Insert(EntryFingerprint(history.user_history_base.entries(i)),
++ history.user_history_base.entries(i));
+ }
+
+- VLOG(1) << "Loaded user histroy, size=" << history.entries_size();
++ VLOG(1) << "Loaded user histroy, size=" << history.user_history_base.entries_size();
+
+ return true;
+ }
+@@ -521,13 +521,13 @@
+
+ UserHistoryStorage history(filename);
+ for (const DicElement *elm = tail; elm != nullptr; elm = elm->prev) {
+- history.add_entries()->CopyFrom(elm->value);
++ history.user_history_base.add_entries()->CopyFrom(elm->value);
+ }
+
+ // Updates usage stats here.
+ UsageStats::SetInteger(
+ "UserHistoryPredictorEntrySize",
+- static_cast<int>(history.entries_size()));
++ static_cast<int>(history.user_history_base.entries_size()));
+
+ if (!history.Save()) {
+ LOG(ERROR) << "UserHistoryStorage::Save() failed";
+--- /src/prediction/user_history_predictor.h
++++ /src/prediction/user_history_predictor.h
+@@ -61,11 +61,15 @@
+ class UserHistoryPredictorSyncer;
+
+ // Added serialization method for UserHistory.
+-class UserHistoryStorage : public mozc::user_history_predictor::UserHistory {
++class UserHistoryStorage {
+ public:
+ explicit UserHistoryStorage(const string &filename);
+ ~UserHistoryStorage();
+
++ // Instance of base class generated by Protocol Buffers compiler.
++ // Regular inheritance strongly discouraged.
++ mozc::user_history_predictor::UserHistory user_history_base;
++
+ // Loads from encrypted file.
+ bool Load();
+
+--- /src/prediction/user_history_predictor_test.cc
++++ /src/prediction/user_history_predictor_test.cc
+@@ -2222,7 +2222,7 @@
+
+ UserHistoryStorage storage1(filename);
+
+- UserHistoryPredictor::Entry *entry = storage1.add_entries();
++ UserHistoryPredictor::Entry *entry = storage1.user_history_base.add_entries();
+ CHECK(entry);
+ entry->set_key("key");
+ entry->set_key("value");
+@@ -2230,7 +2230,7 @@
+ UserHistoryStorage storage2(filename);
+ storage2.Load();
+
+- EXPECT_EQ(storage1.DebugString(), storage2.DebugString());
++ EXPECT_EQ(storage1.user_history_base.DebugString(), storage2.user_history_base.DebugString());
+ FileUtil::Unlink(filename);
+ }
+
+--- /src/rewriter/usage_rewriter_test.cc
++++ /src/rewriter/usage_rewriter_test.cc
+@@ -312,7 +312,7 @@
+ // Load mock data
+ {
+ UserDictionaryStorage storage("");
+- UserDictionaryStorage::UserDictionary *dic = storage.add_dictionaries();
++ UserDictionaryStorage::UserDictionary *dic = storage.user_dictionary_storage_base.add_dictionaries();
+
+ UserDictionaryStorage::UserDictionaryEntry *entry = dic->add_entries();
+ entry->set_key("うま");
+@@ -320,7 +320,7 @@
+ entry->set_pos(user_dictionary::UserDictionary::NOUN);
+ entry->set_comment("アルパカコメント");
+
+- user_dictionary_->Load(storage);
++ user_dictionary_->Load(storage.user_dictionary_storage_base);
+ }
+
+ // Emulates the conversion of key="うま".
diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
index 21a1291f1ea5..d4572c6e9708 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -106,6 +106,7 @@ src_unpack() {
src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch"
diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index 7876d9ed3783..144d03b4d78f 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -106,6 +106,7 @@ src_unpack() {
src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch"