summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 18:32:10 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 18:32:10 +0000
commit99ca9a111b9970a9f36f5251acceb9ee0b1124e1 (patch)
tree6941ec3d2990db13a0da730616097e1417ad2069
parent6d8ffc9f70711222db4aaaca570be0574e88de42 (diff)
downloadchromium_src-99ca9a111b9970a9f36f5251acceb9ee0b1124e1.zip
chromium_src-99ca9a111b9970a9f36f5251acceb9ee0b1124e1.tar.gz
chromium_src-99ca9a111b9970a9f36f5251acceb9ee0b1124e1.tar.bz2
Use env_vars::kHeadless instead of hard coded strings.
BUG=none TEST=none Review URL: http://codereview.chromium.org/876002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41451 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/breakpad_linux.cc3
-rw-r--r--chrome/app/breakpad_win.cc8
-rw-r--r--chrome/browser/child_process_host.cc3
-rw-r--r--chrome/browser/crash_handler_host_linux.cc3
4 files changed, 11 insertions, 6 deletions
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc
index e526659..a109be2 100644
--- a/chrome/app/breakpad_linux.cc
+++ b/chrome/app/breakpad_linux.cc
@@ -32,6 +32,7 @@
#include "chrome/common/chrome_descriptors.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/env_vars.h"
#include "chrome/installer/util/google_update_settings.h"
static const char kUploadURL[] =
@@ -721,7 +722,7 @@ void InitCrashReporter() {
const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
const std::string process_type =
parsed_command_line.GetSwitchValueASCII(switches::kProcessType);
- const bool unattended = (getenv("CHROME_HEADLESS") != NULL);
+ const bool unattended = (getenv(WideToASCII(env_vars::kHeadless)) != NULL);
if (process_type.empty()) {
if (!(unattended || GoogleUpdateSettings::GetCollectStatsConsent()))
return;
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index a0ed497..27a2d80 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -7,6 +7,8 @@
#include <windows.h>
#include <shellapi.h>
#include <tchar.h>
+
+#include <algorithm>
#include <vector>
#include "base/base_switches.h"
@@ -16,12 +18,12 @@
#include "base/registry.h"
#include "base/string_util.h"
#include "base/win_util.h"
+#include "breakpad/src/client/windows/handler/exception_handler.h"
#include "chrome/app/hard_error_handler_win.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/result_codes.h"
-#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/google_update_settings.h"
-#include "breakpad/src/client/windows/handler/exception_handler.h"
+#include "chrome/installer/util/install_util.h"
namespace {
@@ -343,7 +345,7 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
const CommandLine& command = *CommandLine::ForCurrentProcess();
bool use_crash_service = command.HasSwitch(switches::kNoErrorDialogs) ||
- GetEnvironmentVariable(L"CHROME_HEADLESS", NULL, 0);
+ GetEnvironmentVariable(env_vars::kHeadless, NULL, 0);
bool is_per_user_install =
InstallUtil::IsPerUserInstall(info->dll_path.c_str());
diff --git a/chrome/browser/child_process_host.cc b/chrome/browser/child_process_host.cc
index 3aea690..d27ebeb 100644
--- a/chrome/browser/child_process_host.cc
+++ b/chrome/browser/child_process_host.cc
@@ -18,6 +18,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/env_vars.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_type.h"
#include "chrome/common/plugin_messages.h"
@@ -114,7 +115,7 @@ FilePath ChildProcessHost::GetChildPath(bool allow_self) {
// static
void ChildProcessHost::SetCrashReporterCommandLine(CommandLine* command_line) {
#if defined(USE_LINUX_BREAKPAD)
- const bool unattended = (getenv("CHROME_HEADLESS") != NULL);
+ const bool unattended = (getenv(WideToASCII(env_vars::kHeadless)) != NULL);
if (unattended || GoogleUpdateSettings::GetCollectStatsConsent()) {
command_line->AppendSwitchWithValue(switches::kEnableCrashReporter,
ASCIIToWide(google_update::posix_guid +
diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linux.cc
index dc803ec..b7a7367 100644
--- a/chrome/browser/crash_handler_host_linux.cc
+++ b/chrome/browser/crash_handler_host_linux.cc
@@ -25,6 +25,7 @@
#include "chrome/app/breakpad_linux.h"
#include "chrome/browser/chrome_thread.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/env_vars.h"
// Since classes derived from CrashHandlerHostLinux are singletons, it's only
// destroyed at the end of the processes lifetime, which is greater in span than
@@ -194,7 +195,7 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) {
bool upload = true;
FilePath dumps_path("/tmp");
- if (getenv("CHROME_HEADLESS")) {
+ if (getenv(WideToASCII(env_vars::kHeadless))) {
upload = false;
PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path);
}