From 6c817557ed5fa92658cfc0616fe72a71643491f9 Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Thu, 8 Jul 2010 03:56:17 +0000 Subject: 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 --- courgette/encoded_program.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'courgette/encoded_program.cc') diff --git a/courgette/encoded_program.cc b/courgette/encoded_program.cc index 1265312..71bd65a 100644 --- a/courgette/encoded_program.cc +++ b/courgette/encoded_program.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -9,8 +9,10 @@ #include #include +#include "base/env_var.h" #include "base/logging.h" -#include "base/sys_info.h" +#include "base/scoped_ptr.h" +#include "base/string_util.h" #include "courgette/courgette.h" #include "courgette/streams.h" @@ -264,9 +266,11 @@ enum FieldSelect { static FieldSelect GetFieldSelect() { #if 1 // TODO(sra): Use better configuration. - std::wstring s = base::SysInfo::GetEnvVar(L"A_FIELDS"); + scoped_ptr env(base::EnvVarGetter::Create()); + std::string s; + env->GetEnv("A_FIELDS", &s); if (!s.empty()) { - return static_cast(wcstoul(s.c_str(), 0, 0)); + return static_cast(wcstoul(ASCIIToWide(s).c_str(), 0, 0)); } #endif return static_cast(~0); -- cgit v1.1