diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 01:03:37 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 01:03:37 +0000 |
commit | c87bcf000fde1dd7194b5e40e8c9f1058700dd9d (patch) | |
tree | 96a15051e2b4c4fffec09174936c50654a52587f | |
parent | 75464782c1f117bc736cb253c8df39572cc389c9 (diff) | |
download | chromium_src-c87bcf000fde1dd7194b5e40e8c9f1058700dd9d.zip chromium_src-c87bcf000fde1dd7194b5e40e8c9f1058700dd9d.tar.gz chromium_src-c87bcf000fde1dd7194b5e40e8c9f1058700dd9d.tar.bz2 |
base: rename Environment::SetEnv to Environment::SetVar.
This is the part 3 of this series. One more remaining. Splitting this
into small parts, so it is more easy to review and reduce the size of the CL.
BUG=None
TEST=trybots
Review URL: http://codereview.chromium.org/2836088
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55168 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | app/l10n_util_unittest.cc | 10 | ||||
-rw-r--r-- | base/environment.cc | 6 | ||||
-rw-r--r-- | base/environment.h | 2 | ||||
-rw-r--r-- | base/environment_unittest.cc | 6 | ||||
-rw-r--r-- | base/nss_util.cc | 2 | ||||
-rw-r--r-- | base/xdg_util_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/locale_tests_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/shell_integration_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/zygote_host_linux.cc | 2 | ||||
-rw-r--r-- | chrome/common/logging_chrome_uitest.cc | 4 | ||||
-rw-r--r-- | chrome/plugin/plugin_main_mac.mm | 2 | ||||
-rw-r--r-- | net/proxy/proxy_config_service_linux_unittest.cc | 2 |
12 files changed, 21 insertions, 21 deletions
diff --git a/app/l10n_util_unittest.cc b/app/l10n_util_unittest.cc index 9106ee2..85c5296 100644 --- a/app/l10n_util_unittest.cc +++ b/app/l10n_util_unittest.cc @@ -144,23 +144,23 @@ TEST_F(L10nUtilTest, GetAppLocale) { // Test the support of LANGUAGE environment variable. SetICUDefaultLocale("en-US"); - env->SetEnv("LANGUAGE", "xx:fr_CA"); + env->SetVar("LANGUAGE", "xx:fr_CA"); EXPECT_EQ("fr", l10n_util::GetApplicationLocale("")); - env->SetEnv("LANGUAGE", "xx:yy:en_gb.utf-8@quot"); + env->SetVar("LANGUAGE", "xx:yy:en_gb.utf-8@quot"); EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale("")); - env->SetEnv("LANGUAGE", "xx:zh-hk"); + env->SetVar("LANGUAGE", "xx:zh-hk"); EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale("")); // We emulate gettext's behavior here, which ignores LANG/LC_MESSAGES/LC_ALL // when LANGUAGE is specified. If no language specified in LANGUAGE is valid, // then just fallback to the default language, which is en-US for us. SetICUDefaultLocale("fr-FR"); - env->SetEnv("LANGUAGE", "xx:yy"); + env->SetVar("LANGUAGE", "xx:yy"); EXPECT_EQ("en-US", l10n_util::GetApplicationLocale("")); - env->SetEnv("LANGUAGE", "/fr:zh_CN"); + env->SetVar("LANGUAGE", "/fr:zh_CN"); EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale("")); // Make sure the follow tests won't be affected by LANGUAGE environment diff --git a/base/environment.cc b/base/environment.cc index 4ff6a74..6a6b556 100644 --- a/base/environment.cc +++ b/base/environment.cc @@ -40,8 +40,8 @@ class EnvironmentImpl : public base::Environment { return GetEnvImpl(alternate_case_var.c_str(), result); } - virtual bool SetEnv(const char* variable_name, const std::string& new_value) { - return SetEnvImpl(variable_name, new_value); + virtual bool SetVar(const char* variable_name, const std::string& new_value) { + return SetVarImpl(variable_name, new_value); } virtual bool UnSetVar(const char* variable_name) { @@ -75,7 +75,7 @@ class EnvironmentImpl : public base::Environment { #endif } - bool SetEnvImpl(const char* variable_name, const std::string& new_value) { + bool SetVarImpl(const char* variable_name, const std::string& new_value) { #if defined(OS_POSIX) // On success, zero is returned. return setenv(variable_name, new_value.c_str(), 1) == 0; diff --git a/base/environment.h b/base/environment.h index 4e2a6e7..ac83de3 100644 --- a/base/environment.h +++ b/base/environment.h @@ -36,7 +36,7 @@ class Environment { virtual bool HasVar(const char* variable_name); // Returns true on success, otherwise returns false. - virtual bool SetEnv(const char* variable_name, + virtual bool SetVar(const char* variable_name, const std::string& new_value) = 0; // Returns true on success, otherwise returns false. diff --git a/base/environment_unittest.cc b/base/environment_unittest.cc index 302a0d0..ba48123 100644 --- a/base/environment_unittest.cc +++ b/base/environment_unittest.cc @@ -23,12 +23,12 @@ TEST_F(EnvironmentTest, HasVar) { EXPECT_TRUE(env->HasVar("PATH")); } -TEST_F(EnvironmentTest, SetEnvVar) { +TEST_F(EnvironmentTest, SetVar) { scoped_ptr<base::Environment> env(base::Environment::Create()); const char kFooUpper[] = "FOO"; const char kFooLower[] = "foo"; - EXPECT_TRUE(env->SetEnv(kFooUpper, kFooLower)); + EXPECT_TRUE(env->SetVar(kFooUpper, kFooLower)); // Now verify that the environment has the new variable. EXPECT_TRUE(env->HasVar(kFooUpper)); @@ -44,7 +44,7 @@ TEST_F(EnvironmentTest, UnSetVar) { const char kFooUpper[] = "FOO"; const char kFooLower[] = "foo"; // First set some environment variable. - EXPECT_TRUE(env->SetEnv(kFooUpper, kFooLower)); + EXPECT_TRUE(env->SetVar(kFooUpper, kFooLower)); // Now verify that the environment has the new variable. EXPECT_TRUE(env->HasVar(kFooUpper)); diff --git a/base/nss_util.cc b/base/nss_util.cc index ac6752e..cd44fed 100644 --- a/base/nss_util.cc +++ b/base/nss_util.cc @@ -83,7 +83,7 @@ void UseLocalCacheOfNSSDatabaseIfNFS(const FilePath& database_dir) { scoped_ptr<base::Environment> env(base::Environment::Create()); const char* use_cache_env_var = "NSS_SDB_USE_CACHE"; if (!env->HasVar(use_cache_env_var)) - env->SetEnv(use_cache_env_var, "yes"); + env->SetVar(use_cache_env_var, "yes"); } } #endif // defined(OS_LINUX) diff --git a/base/xdg_util_unittest.cc b/base/xdg_util_unittest.cc index 01e566c..09f65c4 100644 --- a/base/xdg_util_unittest.cc +++ b/base/xdg_util_unittest.cc @@ -18,7 +18,7 @@ namespace { class MockEnvironment : public base::Environment { public: MOCK_METHOD2(GetEnv, bool(const char*, std::string* result)); - MOCK_METHOD2(SetEnv, bool(const char*, const std::string& new_value)); + MOCK_METHOD2(SetVar, bool(const char*, const std::string& new_value)); MOCK_METHOD1(UnSetVar, bool(const char*)); }; diff --git a/chrome/browser/locale_tests_uitest.cc b/chrome/browser/locale_tests_uitest.cc index b8f5e32..85a9510 100644 --- a/chrome/browser/locale_tests_uitest.cc +++ b/chrome/browser/locale_tests_uitest.cc @@ -17,7 +17,7 @@ class LocaleTestsBase : public UITest { #if defined(OS_LINUX) scoped_ptr<base::Environment> env(base::Environment::Create()); if (old_lc_all_) { - env->SetEnv("LC_ALL", old_lc_all_); + env->SetVar("LC_ALL", old_lc_all_); } else { env->UnSetVar("LC_ALL"); } diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc index 4353911..28f02c6 100644 --- a/chrome/browser/shell_integration_unittest.cc +++ b/chrome/browser/shell_integration_unittest.cc @@ -48,7 +48,7 @@ class MockEnvironment : public base::Environment { return false; } - virtual bool SetEnv(const char* variable_name, const std::string& new_value) { + virtual bool SetVar(const char* variable_name, const std::string& new_value) { ADD_FAILURE(); return false; } diff --git a/chrome/browser/zygote_host_linux.cc b/chrome/browser/zygote_host_linux.cc index be0ce5a..0d57b55 100644 --- a/chrome/browser/zygote_host_linux.cc +++ b/chrome/browser/zygote_host_linux.cc @@ -44,7 +44,7 @@ static void SaveSUIDUnsafeEnvironmentVariables() { scoped_ptr<base::Environment> env(base::Environment::Create()); std::string value; if (env->GetEnv(envvar, &value)) - env->SetEnv(saved_envvar, value); + env->SetVar(saved_envvar, value); else env->UnSetVar(saved_envvar); diff --git a/chrome/common/logging_chrome_uitest.cc b/chrome/common/logging_chrome_uitest.cc index 2a2e89b..a8c39c0 100644 --- a/chrome/common/logging_chrome_uitest.cc +++ b/chrome/common/logging_chrome_uitest.cc @@ -29,14 +29,14 @@ class ChromeLoggingTest : public testing::Test { if (!env->GetEnv(env_vars::kLogFileName, &environment_filename_)) environment_filename_ = ""; - env->SetEnv(env_vars::kLogFileName, new_value); + env->SetVar(env_vars::kLogFileName, new_value); } // Restores the value of the log file nave environment variable // previously saved by SaveEnvironmentVariable(). void RestoreEnvironmentVariable() { scoped_ptr<base::Environment> env(base::Environment::Create()); - env->SetEnv(env_vars::kLogFileName, environment_filename_); + env->SetVar(env_vars::kLogFileName, environment_filename_); } private: diff --git a/chrome/plugin/plugin_main_mac.mm b/chrome/plugin/plugin_main_mac.mm index cc5b67e..46f9183 100644 --- a/chrome/plugin/plugin_main_mac.mm +++ b/chrome/plugin/plugin_main_mac.mm @@ -36,7 +36,7 @@ void TrimInterposeEnvironment() { strcmp(interpose_list.c_str() + suffix_offset, plugin_interpose_strings::kInterposeLibraryPath) == 0) { std::string trimmed_list = interpose_list.substr(0, suffix_offset - 1); - env->SetEnv(plugin_interpose_strings::kDYLDInsertLibrariesKey, + env->SetVar(plugin_interpose_strings::kDYLDInsertLibrariesKey, trimmed_list.c_str()); } else { NOTREACHED() << "Missing Carbon interposing library"; diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc index 6be44fe..74eddc8 100644 --- a/net/proxy/proxy_config_service_linux_unittest.cc +++ b/net/proxy/proxy_config_service_linux_unittest.cc @@ -115,7 +115,7 @@ class MockEnvironment : public base::Environment { return false; } - virtual bool SetEnv(const char* variable_name, const std::string& new_value) { + virtual bool SetVar(const char* variable_name, const std::string& new_value) { ADD_FAILURE(); return false; } |