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

Unified Diff: chrome/common/metrics/experiments_helper.cc

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/metrics/experiments_helper.h ('k') | chrome/common/metrics/experiments_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/metrics/experiments_helper.cc
===================================================================
--- chrome/common/metrics/experiments_helper.cc (revision 144791)
+++ chrome/common/metrics/experiments_helper.cc (working copy)
@@ -4,6 +4,7 @@
#include "chrome/common/metrics/experiments_helper.h"
+#include <map>
#include <vector>
#include "base/memory/singleton.h"
@@ -130,6 +131,25 @@
MakeSelectedGroupId(trial_name, group_name));
}
+void GenerateExperimentChunks(const std::vector<string16>& experiments,
+ std::vector<string16>* chunks) {
+ string16 current_chunk;
+ for (size_t i = 0; i < experiments.size(); ++i) {
+ const size_t needed_length =
+ (current_chunk.empty() ? 1 : 0) + experiments[i].length();
+ if (current_chunk.length() + needed_length > kMaxExperimentChunkSize) {
+ chunks->push_back(current_chunk);
+ current_chunk = experiments[i];
+ } else {
+ if (!current_chunk.empty())
+ current_chunk.push_back(',');
+ current_chunk += experiments[i];
+ }
+ }
+ if (!current_chunk.empty())
+ chunks->push_back(current_chunk);
+}
+
void SetChildProcessLoggingExperimentList() {
std::vector<SelectedGroupId> name_group_ids;
GetFieldTrialSelectedGroupIds(&name_group_ids);
« no previous file with comments | « chrome/common/metrics/experiments_helper.h ('k') | chrome/common/metrics/experiments_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698