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

Unified Diff: chrome/app/breakpad_win.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 | « no previous file | chrome/app/client_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/breakpad_win.cc
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index a21f5b50cb6c2a0dadc56ceb7302e8681b263e23..183887dcdf467005eb346f24dc88d6739c9ec564 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
« no previous file with comments | « no previous file | chrome/app/client_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698