Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1904)

Unified Diff: chrome/app/client_util.cc

Issue 3076042: Use Environment::SetVar in more places. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: rebased to ToT Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | chrome/browser/browser_main_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/client_util.cc
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc
index a360d516252e48d0fd69bd6f828afc03f20ef2a0..61d8c40cff6749d58080eebe12234552957fa9c0 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);
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | chrome/browser/browser_main_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698