diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-08 03:56:17 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-08 03:56:17 +0000 |
commit | 6c817557ed5fa92658cfc0616fe72a71643491f9 (patch) | |
tree | beb3ef6cdc6aaa5e5737b64d23bd62cca0787a1c /base | |
parent | 33d396b083d7096f7c44ea76fd4a6765dec75d87 (diff) | |
download | chromium_src-6c817557ed5fa92658cfc0616fe72a71643491f9.zip chromium_src-6c817557ed5fa92658cfc0616fe72a71643491f9.tar.gz chromium_src-6c817557ed5fa92658cfc0616fe72a71643491f9.tar.bz2 |
base: Get rid of the deprecated SysInfo::GetEnvVar.
Use the new EnvVarGetter::GetEnv instead.
BUG=None
TEST=trybots
Review URL: http://codereview.chromium.org/2876045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51829 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/sys_info.h | 5 | ||||
-rw-r--r-- | base/sys_info_posix.cc | 11 | ||||
-rw-r--r-- | base/sys_info_unittest.cc | 5 | ||||
-rw-r--r-- | base/sys_info_win.cc | 11 |
4 files changed, 0 insertions, 32 deletions
diff --git a/base/sys_info.h b/base/sys_info.h index cefce13..1bb4eca 100644 --- a/base/sys_info.h +++ b/base/sys_info.h @@ -30,11 +30,6 @@ class SysInfo { // or -1 on failure. static int64 AmountOfFreeDiskSpace(const FilePath& path); - // Return the value of the given environment variable - // or an empty string if not defined. - // DEPRECATED in favor of EnvVarGetter in base/env_var.h. - static std::wstring GetEnvVar(const wchar_t* var); - // Returns the name of the host operating system. static std::string OperatingSystemName(); diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc index f2d75d2..3f487e5 100644 --- a/base/sys_info_posix.cc +++ b/base/sys_info_posix.cc @@ -47,17 +47,6 @@ int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { } // static -std::wstring SysInfo::GetEnvVar(const wchar_t* var) { - std::string var_utf8 = WideToUTF8(std::wstring(var)); - char* value = getenv(var_utf8.c_str()); - if (!value) { - return std::wstring(); - } else { - return UTF8ToWide(value); - } -} - -// static std::string SysInfo::OperatingSystemName() { utsname info; if (uname(&info) < 0) { diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc index 79f172d..3e51890 100644 --- a/base/sys_info_unittest.cc +++ b/base/sys_info_unittest.cc @@ -28,11 +28,6 @@ TEST_F(SysInfoTest, AmountOfFreeDiskSpace) { << tmp_path.value(); } -TEST_F(SysInfoTest, GetEnvVar) { - // Every setup should have non-empty PATH... - EXPECT_NE(base::SysInfo::GetEnvVar(L"PATH"), L""); -} - #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS) TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { int32 os_major_version = -1; diff --git a/base/sys_info_win.cc b/base/sys_info_win.cc index 35a7878..ed4d2fb 100644 --- a/base/sys_info_win.cc +++ b/base/sys_info_win.cc @@ -48,17 +48,6 @@ int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { } // static -std::wstring SysInfo::GetEnvVar(const wchar_t* var) { - DWORD value_length = GetEnvironmentVariable(var, NULL, 0); - if (value_length == 0) { - return L""; - } - scoped_array<wchar_t> value(new wchar_t[value_length]); - GetEnvironmentVariable(var, value.get(), value_length); - return std::wstring(value.get()); -} - -// static std::string SysInfo::OperatingSystemName() { return "Windows NT"; } |