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

Unified Diff: chrome/common/child_process_logging_mac.mm

Issue 10661057: [Mac] Add field trial tuples to breakpad crash reports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/common/child_process_logging.h ('k') | chrome/common/metrics/experiments_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/child_process_logging_mac.mm
===================================================================
--- chrome/common/child_process_logging_mac.mm (revision 144791)
+++ chrome/common/child_process_logging_mac.mm (working copy)
@@ -13,6 +13,7 @@
#include "base/stringprintf.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
+#include "chrome/common/metrics/experiments_helper.h"
#include "chrome/installer/util/google_update_settings.h"
#include "content/public/common/gpu_info.h"
#include "googleurl/src/gurl.h"
@@ -220,8 +221,31 @@
}
}
-void SetExperimentList(const std::vector<string16>& state) {
- // TODO(mad): Implement this.
+void SetExperimentList(const std::vector<string16>& experiments) {
+ // These should match the corresponding strings in breakpad_win.cc.
+ NSString* const kNumExperimentsKey = @"num-experiments";
+ NSString* const kExperimentChunkFormat = @"experiment-chunk-%zu"; // 1-based.
+
+ std::vector<string16> chunks;
+ experiments_helper::GenerateExperimentChunks(experiments, &chunks);
+
+ // Store up to |kMaxReportedExperimentChunks| chunks.
+ for (size_t i = 0; i < kMaxReportedExperimentChunks; ++i) {
+ NSString* key = [NSString stringWithFormat:kExperimentChunkFormat, i + 1];
+ if (i < chunks.size()) {
+ NSString* value = base::SysUTF16ToNSString(chunks[i]);
+ SetCrashKeyValue(key, value);
+ } else {
+ ClearCrashKey(key);
+ }
+ }
+
+ // Make note of the total number of experiments, which may be greater than
+ // what was able to fit in |kMaxReportedExperimentChunks|. This is useful
+ // when correlating stability with the number of experiments running
+ // simultaneously.
+ SetCrashKeyValue(kNumExperimentsKey,
+ [NSString stringWithFormat:@"%zu", experiments.size()]);
}
void SetChannel(const std::string& channel) {
« no previous file with comments | « chrome/common/child_process_logging.h ('k') | chrome/common/metrics/experiments_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698