summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-14 15:57:04 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-14 15:57:04 +0000
commitbc982a9d307b187d1bd86f278c6bd4cd08e4bcbb (patch)
treebef6b7d06c8c99efe7c4f6f592cedc1a90c4fd61 /chrome/common
parent93baa2f9d381a40447a923a2f4b8e1c9067f6665 (diff)
downloadchromium_src-bc982a9d307b187d1bd86f278c6bd4cd08e4bcbb.zip
chromium_src-bc982a9d307b187d1bd86f278c6bd4cd08e4bcbb.tar.gz
chromium_src-bc982a9d307b187d1bd86f278c6bd4cd08e4bcbb.tar.bz2
Set the product channel in crash reports using the crash key logging system.
BUG=77656 Review URL: https://chromiumcodereview.appspot.com/23658051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/child_process_logging.h6
-rw-r--r--chrome/common/child_process_logging_mac.mm6
-rw-r--r--chrome/common/child_process_logging_posix.cc7
-rw-r--r--chrome/common/crash_keys.cc3
-rw-r--r--chrome/common/crash_keys.h3
5 files changed, 6 insertions, 19 deletions
diff --git a/chrome/common/child_process_logging.h b/chrome/common/child_process_logging.h
index 1bc62e7..d152499 100644
--- a/chrome/common/child_process_logging.h
+++ b/chrome/common/child_process_logging.h
@@ -40,7 +40,6 @@ namespace child_process_logging {
#if defined(OS_POSIX) && !defined(OS_MACOSX)
// These are declared here so the crash reporter can access them directly in
// compromised context without going through the standard library.
-extern char g_channel[];
extern char g_client_id[];
extern char g_num_switches[];
extern char g_num_variations[];
@@ -74,11 +73,6 @@ void SetCommandLine(const CommandLine* command_line);
// Initialize the list of experiment info to send along with crash reports.
void SetExperimentList(const std::vector<string16>& state);
-#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_MACOSX)
-// Sets the product channel data to send along with crash reports to |channel|.
-void SetChannel(const std::string& channel);
-#endif
-
// Set/clear information about currently accessed printer.
class ScopedPrinterInfoSetter {
public:
diff --git a/chrome/common/child_process_logging_mac.mm b/chrome/common/child_process_logging_mac.mm
index 2e1abd2..a6ac715 100644
--- a/chrome/common/child_process_logging_mac.mm
+++ b/chrome/common/child_process_logging_mac.mm
@@ -118,10 +118,4 @@ void SetExperimentList(const std::vector<string16>& experiments) {
base::StringPrintf("%zu", experiments.size()));
}
-void SetChannel(const std::string& channel) {
- // This should match the corresponding string in breakpad_win.cc.
- const std::string kChannelKey = "channel";
- SetCrashKeyValue(kChannelKey, channel);
-}
-
} // namespace child_process_logging
diff --git a/chrome/common/child_process_logging_posix.cc b/chrome/common/child_process_logging_posix.cc
index 9b9b5b51..e0c11a0 100644
--- a/chrome/common/child_process_logging_posix.cc
+++ b/chrome/common/child_process_logging_posix.cc
@@ -17,15 +17,12 @@ namespace child_process_logging {
// Account for the terminating null character.
static const size_t kClientIdSize = 32 + 1;
-static const size_t kChannelSize = 32;
// We use static strings to hold the most recent active url and the client
// identifier. If we crash, the crash handler code will send the contents of
// these strings to the browser.
char g_client_id[kClientIdSize];
-char g_channel[kChannelSize] = "";
-
char g_printer_info[kPrinterInfoStrLen * kMaxReportedPrinterRecords + 1] = "";
static const size_t kNumSize = 32;
@@ -111,8 +108,4 @@ void SetExperimentList(const std::vector<string16>& experiments) {
experiments.size());
}
-void SetChannel(const std::string& channel) {
- base::strlcpy(g_channel, channel.c_str(), arraysize(g_channel));
-}
-
} // namespace child_process_logging
diff --git a/chrome/common/crash_keys.cc b/chrome/common/crash_keys.cc
index 234a9a5..7a3e6ec 100644
--- a/chrome/common/crash_keys.cc
+++ b/chrome/common/crash_keys.cc
@@ -48,6 +48,8 @@ COMPILE_ASSERT(kMediumSize <= kSingleChunkLength,
mac_has_medium_size_crash_key_chunks);
#endif
+const char kChannel[] = "channel";
+
const char kActiveURL[] = "url-chunk";
const char kExtensionID[] = "extension-%" PRIuS;
@@ -95,6 +97,7 @@ size_t RegisterChromeCrashKeys() {
// The following keys may be chunked by the underlying crash logging system,
// but ultimately constitute a single key-value pair.
base::debug::CrashKey fixed_keys[] = {
+ { kChannel, kSmallSize },
{ kActiveURL, kLargeSize },
{ kNumExtensionsCount, kSmallSize },
{ kNumberOfViews, kSmallSize },
diff --git a/chrome/common/crash_keys.h b/chrome/common/crash_keys.h
index 2048903..75d34eb 100644
--- a/chrome/common/crash_keys.h
+++ b/chrome/common/crash_keys.h
@@ -26,6 +26,9 @@ void SetActiveExtensions(const std::set<std::string>& extensions);
// Crash Key Name Constants ////////////////////////////////////////////////////
+// The product release/distribution channel.
+extern const char kChannel[];
+
// The URL of the active tab.
extern const char kActiveURL[];