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

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
Index: chrome/common/child_process_logging_mac.mm
===================================================================
--- chrome/common/child_process_logging_mac.mm (revision 144169)
+++ 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()) {
MAD 2012/06/28 13:03:38 Why not run until the min of kMaxReportedExperimen
Alexei Svitkine (slow) 2012/06/28 14:56:09 I originally had it like that, but then I noticed
Scott Hess - ex-Googler 2012/06/29 00:37:07 Yes, this is the correct approach to take.
+ NSString* value = base::SysUTF16ToNSString(chunks[i]);
+ SetCrashKeyValue(key, value);
+ } else {
+ ClearCrashKey(key);
MAD 2012/06/28 13:03:38 If you keep this, break?
Alexei Svitkine (slow) 2012/06/28 14:56:09 See above. (Break does not achieve the result we w
+ }
+ }
+
+ // 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) {

Powered by Google App Engine
This is Rietveld 408576698