summaryrefslogtreecommitdiffstats
path: root/chrome/app/breakpad_win.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/breakpad_win.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/breakpad_win.cc')
-rw-r--r--chrome/app/breakpad_win.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index a21f5b5..183887d 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -13,9 +13,11 @@
#include "base/base_switches.h"
#include "base/command_line.h"
+#include "base/environment.h"
#include "base/file_util.h"
#include "base/file_version_info.h"
#include "base/registry.h"
+#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "base/win_util.h"
@@ -203,11 +205,11 @@ bool DumpDoneCallback(const wchar_t*, const wchar_t*, void*,
// We set CHROME_CRASHED env var. If the CHROME_RESTART is present.
// This signals the child process to show the 'chrome has crashed' dialog.
- if (!::GetEnvironmentVariableW(ASCIIToWide(env_vars::kRestartInfo).c_str(),
- NULL, 0)) {
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ if (!env->HasVar(env_vars::kRestartInfo)) {
return true;
}
- ::SetEnvironmentVariableW(ASCIIToWide(env_vars::kShowRestart).c_str(), L"1");
+ env->SetVar(env_vars::kShowRestart, "1");
// Now we just start chrome browser with the same command line.
STARTUPINFOW si = {sizeof(si)};
PROCESS_INFORMATION pi;
@@ -501,8 +503,8 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
if (!g_breakpad->IsOutOfProcess()) {
// The out-of-process handler is unavailable.
- ::SetEnvironmentVariable(ASCIIToWide(env_vars::kNoOOBreakpad).c_str(),
- info->process_type.c_str());
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ env->SetVar(env_vars::kNoOOBreakpad, WideToUTF8(info->process_type));
} else {
// Tells breakpad to handle breakpoint and single step exceptions.
// This might break JIT debuggers, but at least it will always