summaryrefslogtreecommitdiffstats
path: root/chrome/app/client_util.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-13 04:54:10 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-13 04:54:10 +0000
commitae0f077f623fe07cc4679dbd6ee32fdc0786678d (patch)
tree5a1aae20b6aeb25e119ca4ae6d7d376b0a092613 /chrome/app/client_util.cc
parentb59805a6a5af63fc849902b4a134fdcd737c13e7 (diff)
downloadchromium_src-ae0f077f623fe07cc4679dbd6ee32fdc0786678d.zip
chromium_src-ae0f077f623fe07cc4679dbd6ee32fdc0786678d.tar.gz
chromium_src-ae0f077f623fe07cc4679dbd6ee32fdc0786678d.tar.bz2
Use Environment::SetVar in more places.
Make use of Environment::SetVar API to replace the calls to the Windows function SetEnvironmentVariable. BUG=None TEST=trybots Review URL: http://codereview.chromium.org/3076042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/client_util.cc')
-rw-r--r--chrome/app/client_util.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc
index a360d51..61d8c40 100644
--- a/chrome/app/client_util.cc
+++ b/chrome/app/client_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 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.
@@ -6,9 +6,12 @@
#include <shlwapi.h>
#include "base/command_line.h"
-#include "base/logging.h"
+#include "base/environment.h"
#include "base/file_util.h"
#include "base/trace_event.h"
+#include "base/logging.h"
+#include "base/scoped_ptr.h"
+#include "base/utf_string_conversions.h"
#include "chrome/app/breakpad_win.h"
#include "chrome/app/client_util.h"
#include "chrome/common/chrome_switches.h"
@@ -228,9 +231,10 @@ int MainDllLoader::Launch(HINSTANCE instance,
if (!dll_)
return ResultCodes::MISSING_DATA;
- ::SetEnvironmentVariableW(
- BrowserDistribution::GetDistribution()->GetEnvVersionKey().c_str(),
- version.c_str());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ env->SetVar(WideToUTF8(
+ BrowserDistribution::GetDistribution()->GetEnvVersionKey()).c_str(),
+ WideToUTF8(version));
InitCrashReporterWithDllPath(file);
OnBeforeLaunch(version);