summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 18:27:01 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 18:27:01 +0000
commitc98c928aa38e31d44c7a792f0d12da84471639ff (patch)
tree1e1050d39385fbdb787f5ae15dd2a38a143c8ebd /chrome/common
parentbab01969064bdb23cbd403aa86ddc85659d7b74e (diff)
downloadchromium_src-c98c928aa38e31d44c7a792f0d12da84471639ff.zip
chromium_src-c98c928aa38e31d44c7a792f0d12da84471639ff.tar.gz
chromium_src-c98c928aa38e31d44c7a792f0d12da84471639ff.tar.bz2
Revert 79651 - Coverity: Pass parameters by reference.
Also remove an unused function that I found. CID=2634,4471,5392,6433,6434,6535,6777,6780,6781,6792,6810,7665,7759,8056,8072, 8637,8718,8726 BUG=none TEST=non R=csilv@chromium.org Review URL: http://codereview.chromium.org/6730046 TBR=jhawkins@chromium.org Review URL: http://codereview.chromium.org/6773015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/extension.cc5
-rw-r--r--chrome/common/extensions/extension.h5
-rw-r--r--chrome/common/extensions/extension_message_bundle.cc2
-rw-r--r--chrome/common/extensions/extension_message_bundle.h2
-rw-r--r--chrome/common/spellcheck_common.cc13
-rw-r--r--chrome/common/spellcheck_common.h8
6 files changed, 27 insertions, 8 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index e65d9e1..d6e0305 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1266,7 +1266,8 @@ bool Extension::ParsePEMKeyBytes(const std::string& input,
return base::Base64Decode(working, output);
}
-bool Extension::ProducePEM(const std::string& input, std::string* output) {
+bool Extension::ProducePEM(const std::string& input,
+ std::string* output) {
CHECK(output);
if (input.length() == 0)
return false;
@@ -1274,7 +1275,7 @@ bool Extension::ProducePEM(const std::string& input, std::string* output) {
return base::Base64Encode(input, output);
}
-bool Extension::FormatPEMForFileOutput(const std::string& input,
+bool Extension::FormatPEMForFileOutput(const std::string input,
std::string* output,
bool is_public) {
CHECK(output);
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 861cad6..6b40f15 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -311,9 +311,8 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// Expects base64 encoded |input| and formats into |output| including
// the appropriate header & footer.
- static bool FormatPEMForFileOutput(const std::string& input,
- std::string* output,
- bool is_public);
+ static bool FormatPEMForFileOutput(const std::string input,
+ std::string* output, bool is_public);
// Determine whether |new_extension| has increased privileges compared to
// its previously granted permissions, specified by |granted_apis|,
diff --git a/chrome/common/extensions/extension_message_bundle.cc b/chrome/common/extensions/extension_message_bundle.cc
index 26e9c97..f0e60bc 100644
--- a/chrome/common/extensions/extension_message_bundle.cc
+++ b/chrome/common/extensions/extension_message_bundle.cc
@@ -336,7 +336,7 @@ ExtensionToL10nMessagesMap* GetExtensionToL10nMessagesMap() {
return &g_extension_to_messages_map.Get().messages_map;
}
-L10nMessagesMap* GetL10nMessagesMap(const std::string& extension_id) {
+L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id) {
ExtensionToL10nMessagesMap::iterator it =
g_extension_to_messages_map.Get().messages_map.find(extension_id);
if (it != g_extension_to_messages_map.Get().messages_map.end())
diff --git a/chrome/common/extensions/extension_message_bundle.h b/chrome/common/extensions/extension_message_bundle.h
index 8f3078e..89e7fd4 100644
--- a/chrome/common/extensions/extension_message_bundle.h
+++ b/chrome/common/extensions/extension_message_bundle.h
@@ -159,6 +159,6 @@ typedef std::map<std::string, L10nMessagesMap > ExtensionToL10nMessagesMap;
ExtensionToL10nMessagesMap* GetExtensionToL10nMessagesMap();
// Returns message map that matches given extension_id, or NULL.
-L10nMessagesMap* GetL10nMessagesMap(const std::string& extension_id);
+L10nMessagesMap* GetL10nMessagesMap(const std::string extension_id);
#endif // CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGE_BUNDLE_H_
diff --git a/chrome/common/spellcheck_common.cc b/chrome/common/spellcheck_common.cc
index 26d90ce..21ff923 100644
--- a/chrome/common/spellcheck_common.cc
+++ b/chrome/common/spellcheck_common.cc
@@ -169,4 +169,17 @@ void SpellCheckLanguages(std::vector<std::string>* languages) {
}
}
+
+std::string GetLanguageFromLanguageRegion(std::string input_language) {
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(g_supported_spellchecker_languages);
+ ++i) {
+ std::string language(
+ g_supported_spellchecker_languages[i].language_region);
+ if (language == input_language)
+ return std::string(g_supported_spellchecker_languages[i].language);
+ }
+
+ return input_language;
+}
+
} // namespace SpellCheckCommon
diff --git a/chrome/common/spellcheck_common.h b/chrome/common/spellcheck_common.h
index cafffa8..9074e16 100644
--- a/chrome/common/spellcheck_common.h
+++ b/chrome/common/spellcheck_common.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -26,6 +26,12 @@ std::string GetCorrespondingSpellCheckLanguage(const std::string& language);
// Get SpellChecker supported languages.
void SpellCheckLanguages(std::vector<std::string>* languages);
+
+// This function returns ll (language code) from ll-RR where 'RR' (region
+// code) is redundant. However, if the region code matters, it's preserved.
+// That is, it returns 'hi' and 'en-GB' for 'hi-IN' and 'en-GB' respectively.
+std::string GetLanguageFromLanguageRegion(std::string input_language);
+
} // namespace SpellCheckCommon
#endif // CHROME_COMMON_SPELLCHECK_COMMON_H_