Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10444)

Unified Diff: chromeos/ime/component_extension_ime_manager.h

Issue 457943002: Improve perforance for component IME extensions initialization by using map instead of vector in Co… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed solution, test green. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromeos/ime/component_extension_ime_manager.cc » ('j') | chromeos/ime/extension_ime_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/ime/component_extension_ime_manager.h
diff --git a/chromeos/ime/component_extension_ime_manager.h b/chromeos/ime/component_extension_ime_manager.h
index c455712d8f32ad952bc88df7cdb87b53e78682f8..b97901c043204a77fa5a80b5fed3eecb8ee37b59 100644
--- a/chromeos/ime/component_extension_ime_manager.h
+++ b/chromeos/ime/component_extension_ime_manager.h
@@ -5,6 +5,7 @@
#ifndef CHROMEOS_IME_COMPONENT_EXTENSION_IME_MANAGER_H_
#define CHROMEOS_IME_COMPONENT_EXTENSION_IME_MANAGER_H_
+#include <map>
#include <set>
#include "base/files/file_path.h"
@@ -88,20 +89,6 @@ class CHROMEOS_EXPORT ComponentExtensionIMEManager {
// Returns true if |extension_id| is whitelisted component extension.
bool IsWhitelistedExtension(const std::string& extension_id);
- // Returns InputMethodId. This function returns empty string if |extension_id|
- // and |engine_id| is not a whitelisted component extention IME.
- std::string GetId(const std::string& extension_id,
- const std::string& engine_id);
-
- // Returns localized name of |input_method_id|.
- std::string GetName(const std::string& input_method_id);
-
- // Returns localized description of |input_method_id|.
- std::string GetDescription(const std::string& input_method_id);
-
- // Returns list of input method id associated with |language|.
- std::vector<std::string> ListIMEByLanguage(const std::string& language);
-
// Returns all IME as InputMethodDescriptors.
input_method::InputMethodDescriptors GetAllIMEAsInputMethodDescriptor();
@@ -113,14 +100,16 @@ class CHROMEOS_EXPORT ComponentExtensionIMEManager {
// |input_method_id|. This function retruns true if it is found, otherwise
// returns false. |out_extension| and |out_engine| can be NULL.
bool FindEngineEntry(const std::string& input_method_id,
- ComponentExtensionIME* out_extension,
- ComponentExtensionEngine* out_engine);
+ ComponentExtensionIME* out_extension);
bool IsInLoginLayoutWhitelist(const std::vector<std::string>& layouts);
scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate_;
- std::vector<ComponentExtensionIME> component_extension_imes_;
+ std::map<std::string, ComponentExtensionIME> component_extension_imes_;
Alexander Alekseev 2014/08/12 00:01:12 nit: add comment (mostly on lifetime of this).
Shu Chen 2014/08/12 04:44:06 Done.
+
+ // For quick check the validity of a given input method id.
+ std::set<std::string> input_method_id_set_;
Alexander Alekseev 2014/08/12 00:01:12 nit: what is the lifetime of this?
Shu Chen 2014/08/12 04:44:06 Done.
std::set<std::string> login_layout_set_;
« no previous file with comments | « no previous file | chromeos/ime/component_extension_ime_manager.cc » ('j') | chromeos/ime/extension_ime_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698